tar & gzip Workshop
Introduction to tar
The tar program provides the ability to create tar archives. Initially, tar archives were used to store files conveniently on magnetic tape. The name tar comes from this use; it stands for tape archiver. You can use tar for the following :
- Storage : Often, tar archives are used to store related files.
- Backup : Because the archive created by tar is capable of preserving file information and directory structure, tar is commonly used for performing full and incremental backups of disks.
- Transportation : You can create an archive on one system, transfer it to another system, and extract the contents there.
Login to SSH secure shell client using the following information:
- Host Name : willow.olemiss.edu
- User Name : student
- Password : Will be provided during the workshop
tar -cvf ex.tar student.txt stu
- -c : create a tar archive
- -t : list contents of archive
- -x : extract contents from archive
- -r : append file to the end of archive
- -v : verbose
- -f : tar file name
Introduction to gzip
gzip is short for GNU zip. It is used to compress files using encryption. The gzip command will add the suffix .gz to the file name and remove the original file.
- To gzip : gzip filename
- To ungzip : gzip -d filename