Posts Tagged ‘Bash’

Unix/Linux Find Size of Files in a Directory

Thursday, December 10th, 2009

Wait… before I try to copy this directory recursively, how big is it?

du -sk /path/to/directory

-s : Display only a total for each argument
-k : Display size in KB

Oh dear. I’m going to need a bigger disk.

Unix/Linux: Follow That File

Wednesday, August 26th, 2009

In Linux/Unix command line you can follow a file with tail -f [filename]. As the file is updated, the screen will update. This is handy for following error logs, etc.

I just learned from a co-worker that the ‘less’ command can do the same thing if you hit shift-F while viewing a file. Apparently less does a lot more than I thought! I think point and click interface is making me soft, I need to ‘man’ up and RTFM on some command line goodies.


$man less