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.

1 thought on “Useful Shell Commands

  1. To empty a file you may try also a shorter

    “> file.log”


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close