Tuesday, 16 December 2014

Get the directory size from the terminal


Getting the size of the directory is easy with the du command, but if you want to get the size of all files in the directory  which should not include the sub-directory, you can use the command given below:

$ls -hs | head -1

This will give you the desired size.

Monday, 8 December 2014

Going invisible on the terminal


Did you ever think that you could type commands that would be invisible on your system but still would execute, provided you typed them correctly? This can be easily done by changing the terminal settings using the following command:

stty -echo


To restore the visibility of your commands, just type the following command:

stty echo