Tar Command Flashcards
What is a tarball?
It’s a a collection of multiple files and directories bundled together into a single file (tape archive), for the convenience of managing storage or distribution.
What is archiving?
Creating a preserved copy of multiple files or directories in a tarball. It is used to manage backups or move data from one system to another
What is the syntax of the Tar command?
tar -cvzf tarball.tar.gz <source>
What are the three main operating modes in the tar utility?
tar -cvzf for creating an archive
tar -xvf for extracting an archive
tar -tf for listing an archive
What do you mean by compressing data?
reducing data size by using compression algorithms
compression saves storage space
and make it easier to transfer files
to reduce its size
You want to compress and archive the “/data” file system. What command would you use
to archive and compress “/data” in one shot?
tar -cvzf data.tar.gz /data
How can you extract a file in the same directory where the tarball is stored?
tar -xvf
<tarball name>
How can you extract a file in a directory other than where the tarball is stored?
tar -xvf
<tarball name> -C <dump directory>
How can you list the contents in a tarball?
tar -tf <tarball name>
How can we know the type of a file?
file <filename>