MySQL Backup and Compress – One Line command

Let’s consider a case where you have limited disk space available in your database server. In addition, you need a database backup quickly. However, you estimate that, the space available in the server for the backup is not enough.

Continue reading

Zip a File or a Folder in Linux CLI

I often require to compress large files or folder to port between servers and often find myself wondering the commands compress them. I usually use “zip” command command to accomplish my task. Option “-9” is used for best compression. This compression is compatible with Microsoft Windows too.

To zip a folder:

zip -9 -r <zip file> <folder name>

To zip a single file:

zip -9 <zip file> <filename>