Thursday, January 11, 2018

My Linux / Shell Cheat Cheat

Here is a list of Shell Commands that I find useful. I'm keeping a log here so I can refer back whenever needed - which happens a lot when I'm debugging live server issues :)

// Check disk space
df -h

// Show total folder size is human readable format - very useful to debug out-of-disk-space errors (to locate the problem)
du -bsh *

Update SWAP space (if you already have configured SWAP before)
1. Make all swap off

sudo swapoff -a

2. Resize the swapfile 

sudo dd if=/dev/zero of=/swapfile bs=1M count=1024

3. Make swapfile usable

sudo mkswap /swapfile

4. Make swapon again
sudo swapon /swapfile

No comments:

Post a Comment

Fork me on GitHub