Let's face it, we are mere mortals that keep forgetting everytime we learn something new. So that's why I created this simple cheatsheet. Every time I forget something important, I want to refer back in one single place instead of scouring the Internet for the same answer that I did before. Hope this will help.
df -h | awk '/^C:\\/ {print $3 "/" $2}'
free -h | awk '/^Mem:/ {print $3 "/" $2}'
ip addr | grep -m1 inet | sed 's/ //' | sed -e 's/scope global dynamic//g'
ps axch -o cmd:15,%mem --sort=-%mem
ps axch -o cmd:15,%cpu --sort=-%cpu
cat /var/log/apt/history.log | grep install | awk '(NR>1)' | sed 's/[^ ]*//' | sed 's/apt install//g' | sed 's/ //'
sed 's/"//g'
sed 's/[^ ]* //'
sed 's/,$//'
sed -e 's/\[[^][]*\]//g'
sed 's/,/ /g'
awk '{print $0}'
awk '(NR>1)'
awk 'NF'
awk '{$1=$1};1
awk 'NR==2{ print; }'
grep -oP '\[\K[^\]]+'
grep -m1 'searchstring' file_name