Archive and compress using tar, star, gzip, and bzip2 Flashcards
What does tar do
Archives files,, does not handle compression
what tar flag creates a new archive
-c
What tar flag lists contents of an archive
-f
What tar flag extracts files from an archive
-x
What tar flag compresses or uncompresses a file in gzip
-z
What tar flag compresses or uncrompesses a file in bzip2
-j
What tar flag reads archive from or to a file
-f
How would you archive two files hello, and world, into helloworld.tar
tar -cf helloworld.tar hello world
How would you list all files in helloworld.tar
tar -tvf helloworld.tar
How would you archive and compress two files hello and world uzing gzip
tar -czvf helloworld.tar.gz hello world
How would you uncompress and extract files from helloworld.tar.gz
tar -zxvf helloworld.tar.gz
What is star
Archiving utility generally used to archive large sets of data; includes pattern-matching and searching features
What flag creates an archive with star
-c
what flag shows results of running a command without executing the actions in star (dry run)
-n
What flag lists contents of file in star
-f=
What flag extracts a file in star
-x
How do you see the difference of files in star
–diff
Archive file1 and file2 into archive.tar using star
star -c f=archive.tar file1 file2
Archive /home/user/file1 and /home/user/file2 into archive.tar using star without changing the current directory
star -c -C /home/user -f=archive.tar file1 file2
Extract archive.tar using star
star -x f=archive.tar
List contents of archive.tar using star
star -t -f=archive.tar
what is gzip
Comrpession utility used to reduce file size; generally used with tar; files are unavailable until unpacked.