Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Output the contents of a file to the powershell host window

Tags:

powershell

This seems like something that should be painfully obvious, but for whatever reason I can't figure it out. From within powershell, I'd like to be able to print the contents of a text file to the host window (or pipe it into another command). I'm looking for something like this:

PS C:\> {some command} README.TXT
These are the contents of the Readme.txt file!
like image 980
Ben McCormack Avatar asked Aug 30 '11 12:08

Ben McCormack


1 Answers

You are looking for:

get-content README.TXT

In short:

gc README.TXT

If you are used to cat, you can use that too, it is just an alias for the above in Powershell.

like image 139
manojlds Avatar answered Oct 21 '22 01:10

manojlds