Linux Cheatsheet

Last edit: 19 Aug 2018

#Display OS
uname -a

#Delete GZip files older than 14 days
find *.gz -mtime +14 -exec rm {} \;

#mySQL dump
mysqldump --opt -uUSERNAME -pPASSWORD -h HOSTNAME DATABASE_NAME > FILENAME.sql

Nginx

/etc/nginx/sites-available
#start nginx
service nginx start

#stop nginx
service nginx stop

#restart nginx
service nginx restart

#reload nginx
service nginx reload

#check nginx config
nginx -t

#check nginx status
service nginx status