Useful Shell Commands

I’m not an expert at all with the linux shell. I know how to run a LAMP stack, but that is about it. Every blue moon I need to use a command that I used last blue moon, but forgot how. This list will now be my list to write down the cool “commands” I learn to accomplish different tasks. That way I don’t have to bug people on #uphpu about it. ;)

  • How many files in a folder? - ls -1 | wc -l
  • How much disk space is a folder taking up? – du -sh .
  • Truncate/Empty a file – cat /dev/null > file.log

I’ll keep adding to the list as I continue my work with Linux.


No related posts.

Posted in General.

One Response

Comments RSS Feed.

  1. Devis said

    To empty a file you may try also a shorter

    “> file.log”

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.

Powered by WP Hashcash