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%) --
More command Windows CMD
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,
- Grep Alternative for Windows CMD or PowerShell: findstr
- Fix Windows Update Install Error 0x80070005
- Read file from Windows CMD (Command Line)
- Cannot access Windows application shortcuts on Start menu and Taskbar
- sudo is not recognized as an internal or external command
- Minecraft Fix: Error: UNKNOWN code: Deep Ocean - Something went wrong in the login process
- Cmd command get current directory location
- [Fix] Microsoft Windows OneDrive 0x8007018b Error Code
- [Solution] The connection to the remote PC was lost, preparing to reconnect - Windows RDP
- [Fix] Microsoft Windows Store error 0x00000005 (Windows 8/10/11)
- Fix Windows Update Error Code: 0x80070643
- Fix: Error code: 0x204 Microsoft Remote Desktop - Unable to connect the remote PC.
More Posts:
- Fix Python WARNING: You are using pip version 19 however version 21 is available - PIP
- [Fix] Linux - bash: useradd: command not found - Linux
- scp: ssh: connect to host xxxx port 22: Connection refused Error - Linux
- hibernate.cfg.xml Configuration and Mapping xml Example - Java
- Java monitoring and management console [jconsole] - Java
- How to take Screenshot on Android device - Android
- How to get nest aware on iPhone - Google
- Hide files and folders on Mac OS X - Mac-OS-X