Useful commands I can never remember

  • by Amando Abreu
  • on 18 September 2016

A list of commands I use often but can’t seem to be able to memorise.

find dirname/ -name \*.sql

find all .sql files in directory called dirname/

sudo du -a /dir/ | sort -n -r | head -n 20

Find and order the 20th largest files in a server in /dir/

grep 'PRETTY_NAME' /etc/*release | cut -d'=' -f2

Get only the value of ‘PRETTY_NAME’ of the /etc/*release file that may look like this:

NAME="Amazon Linux"
ID_LIKE="centos rhel fedora"
PRETTY_NAME="Amazon Linux 2"

About the author

Amando Abreu is a serial entrepreneur, Fractional CTO, and engineer who has been involved in several startups and launched dozens of products. He has worked with companies such as trivago, Portugal Telecom, and Vizrt. He has experience in several industries, most notably e-commerce, SaaS, media, travel, insurance, property development, and construction.
No comments, just