John Threepwood
John Threepwood

Reputation: 16143

Which Windows Shell command will print a file content on the standard output (like cat in Linux)?

Which Windows Shell command will print a file content on the standard output (like cat in Linux) ?

With Google, Stackoverflow, etc, I just could not find a solution, but I am sure, there is an easy one.

Upvotes: 7

Views: 10027

Answers (2)

Scott Izu
Scott Izu

Reputation: 2309

This is kinda hacky but I did this...

Download Git Bash for Windows. This is very useful to open a linux style command prompt on windows.

Then, create a new git repository and add the file you wish to show to the git repo. Then you can git show.

Let's say you have testFile.txt that you wish to show and it is located at "C:\Users\username\Desktop\FolderWhereFileIs"

cd "/c/Users/username/Desktop/FolderWhereFileIs/"
git add -A
git commit -m "Commit with all files"
git show testFile.txt

Upvotes: 0

Brian Rasmussen
Brian Rasmussen

Reputation: 116451

The command is: type <filename>

However, if you want to Unix-fy your Windows shell there are Win32 ports of most of the command Unix style commands.

Upvotes: 13

Related Questions