Even more useful Linux command-line tips and information.

Even more useful Linux command-line tips and information.

How large in total are the contents of a folder? This command will print that for you. This is the total disk usage of all files in the current folder.

du -ackh | tail -n 1

To copy and paste text from an xterm window if you are using a tiling window manager like Awesome as I am at the moment and you can not use Ctrl-C & Ctrl-V, then simply highlight the desired text in the xterm and press both mouse buttons at once, this will copy the text to a buffer. Then you may paste the text in the desired place with the middle mouse button. If you highlight a command with the mouse and press the middle mouse button, then the text will be copied and pasted in one operation, this may not always be what you want. I have used this to copy from an xterm window to the Firefox web browser and it worked a treat. This is the traditional way of copying and pasting text in X.

To close an xterm you have no need of, you may type exit in the terminal prompt, or you can press Ctrl-D and this will also close the terminal window.

This command will print the disk space remaining on the root / folder.

df -Hla | head -n 2

And this command will print all processes that your user is running.

ps aux | grep $LOGNAME