Skip to content

Instantly share code, notes, and snippets.

@darshitvvora
Last active March 23, 2020 10:12
Show Gist options
  • Select an option

  • Save darshitvvora/cfc45d56bf3b63dfc331b74f58e64fb7 to your computer and use it in GitHub Desktop.

Select an option

Save darshitvvora/cfc45d56bf3b63dfc331b74f58e64fb7 to your computer and use it in GitHub Desktop.
Useful Server Operations and Maintainence Command
# Tarzip and compress a folder in linux
tar -zcvf filename.tar.gz /mnt/volume-nyc1-03/foldername
# Check disk space
df -h
# Check current folder path
pwd
# Detach volume (Linode/DigitalOcean) remove text from fstab file
sudo nano /etc/fstab
# Run long running command in background
yum install screen
screen
# run your command and press Ctrl + ad and screen -ls listing all screens
# Reattach screen
screen -r 20449.pts-0.db
# take mysql dump of all DB
mysqldump -u root -p --all-databases | gzip -c -7 > "/mnt/volume_nyc1_06/backup/16-03-2020.sql.gz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment