Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show real-time contents of a file in powershell

Tags:

io

powershell

I have a powershell tab that I would like to run a command on and have it start scrolling the contents of a log file as it is updated. I don't want it to exit (until I ctrl+c) and just continue scrolling the file as it is updated. How would I do this?

I've thought of using a file watcher but I would have to program the logic for determining the lines added and it just seems overall inefficient and like there's an easier way to go.

like image 560
George Mauer Avatar asked Mar 22 '12 04:03

George Mauer


1 Answers

You can do:

get-content file -wait
like image 161
manojlds Avatar answered Nov 15 '22 10:11

manojlds