How do I Compress a directory in Linux?

Using tar command you can compress a directory as follows 
syntax: tar -zcvf archive-name.tar.gz directory-name
Where,
  • -z: Compress archive using gzip program
  • -c: Create archive
  • -v: Verbose i.e display progress while creating archive
  • -f: Archive File name
For example, if you want to compress /home/sjamso/webfiles then the command is:
# tar -zcvf mycompressfile-20-01-11.tar.gz /home/sjamso/webfiles
The above command will create a compress file named mycompressfile-20-01-11.tar.gz in current directory. The compress file will contain all the file in /home, all files in /sjamso and all files in /webfiles
To restore or unzip tar files:
# tar -zxvf mycompressfile-20-01-11.tar.gz
Where -x: Extract files

Comments

Popular posts from this blog

ACTION_FAILED:OU_INVALID: Solution for GoogleApps bulk user upload issue, username@domainname.com:ACTION_FAILED:OU_INVALID. This error is because you have not specified the Org Unit Path properly.

Email Notification in Koha! How to configure Email Notification in Koha 20.11 with postfix?

Moodle OAuth 2. This account is pending email confirmation! Solved