How do I display a text file content in CMD?

ID : 10330

viewed : 71

Tags : cmdcmd

Top 5 Answer for How do I display a text file content in CMD?

vote vote

94

You can use the more command. For example:

more filename.txt 

Take a look at GNU utilities for Win32 or download it:

vote vote

87

We can use the 'type' command to see file contents in cmd.

Example -

type abc.txt 

More information can be found HERE.

vote vote

71

I don't think there is a built-in function for that

xxxx.txt > con 

This opens the files in the default text editor in windows...

type xxxx.txt 

This displays the file in the current window. Maybe this has params you can use...

There is a similar question here: CMD.EXE batch script to display last 10 lines from a txt file So there is a "more" command to display a file from the given line, or you can use the GNU Utilities for Win32 what bryanph suggested in his link.

vote vote

61

You can use the 'more' command to see the content of the file:

more filename.txt 
vote vote

50

Using a single PowerShell command to retrieve the file ending:

powershell -nologo "& "Get-Content -Wait c:\logFile.log -Tail 10" 

It applies to PowerShell 3.0 and newer.

Another option is to create a file called TAIL.CMD with this code:

powershell -nologo "& "Get-Content -Wait %1 -Tail %2" 

Top 3 video Explaining How do I display a text file content in CMD?

Related QUESTION?