Skip to content

Instantly share code, notes, and snippets.

@Drewster727
Forked from darthpanda/my *nix cheatsheet
Created October 1, 2020 14:36
Show Gist options
  • Save Drewster727/dda11c93539356287e0b487d0f21d375 to your computer and use it in GitHub Desktop.
Save Drewster727/dda11c93539356287e0b487d0f21d375 to your computer and use it in GitHub Desktop.
// show disk usage
du -h * | sort -h
du -h --max-depth=1 . | sort -h -r
tree -L 3 --du -h -D
// show deleted files
lsof | grep deleted
// show drive info
lsblk
lsblk -o +UUID
// show processes
ps aux | grep processname
htop
// su as particular user
sudo su username
// daemons/services
sudo service postgresql start
systemctl status postgresql.service
pg_ctl -D /usr/local/var/postgres start/stop
// start long running processes
nohup ./backup_fetch.sh > backup.log &
// Formatting new drives on new AWS ubuntu instance:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html
// formatting new drives
sudo mkfs -t xfs /dev/xvdf
sudo mkdir /data
sudo mount /dev/xvdf /data
// automatic mount on reboot with fstab
sudo vim /etc/fstab
UUID=f4b551ad-949b-4f3a-8755-ac7f8f3f3d32 /data xfs defaults,nofail 0 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment