I'm enthusiastic and passionate about web development and design in all it's forms and love to build application with efficient and simple methods

Sunday, January 4, 2015

File Compress,Gunzip,Mysql Command in Terminal Ubuntu

7:36 PM Posted by Codeinterpreter , No comments
Compress and extract command in Ubuntu.
  • Compress File to Tar:  
tar czf name_of_archive_file.tar.gz name_of_directory_to_tar
  • Extract File from Tar: 
tar -xzvf file.tar.gz
  • Extract gz to MYSQL: 
gunzip < file-name.sql.gz | mysql -u user -p password  database-name
  • Compress MYSQL to gz: 
mysqldump -u user -p password database-name |gzip -9 > file-name.sql.gz 
  • Export
mysqldump -u user  -p password database-name > file-name.sql
  • Import: 
mysql -user -password database-name < file-name.sql

0 comments:

Post a Comment