If you want to read a file using the Windows CMD command and print it on the console, you can make use of the type command,
Type: Displays the contents of a text file or files.
Syntax: TYPE [drive:][path] filename
Example:C:\>type d:\countries.txt
China
USA
France
Poland
Sweden
Japan
Australia
C:\>
If the file is too huge then type command will keep on buffering the text on the console, in such a case you can make use of more command,
C:\>more d:\countries.txt
China
USA
France
Poland
Sweden
Japan
Australia
India
Nepal
Bhutan
Sri Lanka
Germany
Canada
-- More (78%) --
C:\>help more
Displays output one screen at a time.
MORE [/E [/C] [/P] [/S] [/Tn] [+n]] < [drive:][path]filename
command-name | MORE [/E [/C] [/P] [/S] [/Tn] [+n]]
MORE /E [/C] [/P] [/S] [/Tn] [+n] [files]
[drive:][path]filename Specifies a file to display one
the screen at a time.
command-name Specifies a command whose output
will be displayed.
/E Enable extended features
/C Clear screen before displaying page
/P Expand FormFeed characters
/S Squeeze multiple blank lines into a single line
/Tn Expand tabs to n spaces (default 8)
Switches can be present in the MORE environment
variable.
+n Start displaying the first file at line n
files List of files to be displayed. Files in the list
are separated by blanks.
If extended features are enabled, the following commands
are accepted at the -- More -- prompt:
P n Display next n lines
S n Skip next n lines
F Display next file
Q Quit
= Show line number
? Show help line
<space> Display next page
<ret> Display next line
More Posts related to Windows,
- Fix Windows Update Error Code: 0x80070643
- How to Create Awesome Quizzes using Windows 365 Forms
- [Fix] Microsoft Windows Store error 0x00000005 (Windows 8/10/11)
- Windows 365: Restore Deleted Distribution Group using Admin Center (Active Directory)
- How to Change Encoding of File from ANSI to UTF-8 in Windows Notepad
- How to Change the Default Shell in Windows Terminal App
- How to Create a Website (Webpage) using HTML on Windows Notepad
- How to Find the Location of Notepad on Windows 11
- How to locate Python Installation on Windows (10/11)
- Top 5 Fonts for Windows Notepad
- Fix: Windows Update Error Code: 0x800f0922
- Office.com downloading zero byte file name prelanding on Safari browser
- How to Search in Notepad Application on Windows
- Cannot access Windows application shortcuts on Start menu and Taskbar
- How to add Solver Add-in in Microsoft Excel on Mac
- How to Freeze Top Row in Excel for Mac
- [Fix] Microsoft Windows OneDrive 0x8007018b Error Code
- Mac: Sign in Required We cant upload or download your changes because your cached credentials have expired [Word Excel]
- Grep Alternative for Windows CMD or PowerShell: findstr
- Fix: Failed in attempting to update the source: winget
- How to lock cells in Microsoft Excel for Mac
- Enable Cloud Based Clipboard for Images and Text on Windows 10/11
- How to update Microsoft Excel on Mac
- How to Make a Windows Notepad File Read-Only
- sudo is not recognized as an internal or external command
More Posts:
- How to find Integer MAX and MIN Value in Java - Java
- Add Line Break (New Line) in Jupyter Notebook Markup Cell - Python
- How to Transpose a Square Matrix - Java Program - Java
- See actual SharePoint error exception modify web.config - SharePoint
- Mac: Sign in Required We cant upload or download your changes because your cached credentials have expired [Word Excel] - Windows
- 10 Beginners Commands for macOS Terminal Usage - MacOS
- Sort ls command by last modified date and time - Linux
- FileZilla Connection time out Failed to retrieve directory listing - FTP