Skip to content

Instantly share code, notes, and snippets.

@manojiksula
Created December 26, 2014 10:27
Show Gist options
  • Save manojiksula/9562f4d156264474febb to your computer and use it in GitHub Desktop.
Save manojiksula/9562f4d156264474febb to your computer and use it in GitHub Desktop.
Linux Commands

Linux Commands

Database

/* Creating A Backup of database in gz format */

mysqldump -u root -p dbname | gzip -9 > dbname.sql.gz

/* Restore database in gz format in mysql */

gunzip < dbname.sql.gz | mysql -u root -p dbname

File System

/* create a tar.gz archive from a given folder */

tar -zcvf tar-archive-name.tar.gz source-folder-name

/* extract a tar.gz compressed archive */

tar -zxvf tar-archive-name.tar.gz

Remote server to localhost

rsync -avP username@remote_host:/home/username/dir1 place_to_sync_on_local_machine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment