Tar Command Flashcards

1
Q

What is a tarball?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is archiving?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the syntax of the Tar command?

A

tar -cvzf tarball.tar.gz <source>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three main operating modes in the tar utility?

A

tar -cvzf for creating an archive
tar -xvf for extracting an archive
tar -tf for listing an archive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do you mean by compressing data?

A

reducing data size by using compression algorithms

compression saves storage space
and make it easier to transfer files

to reduce its size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

You want to compress and archive the “/data” file system. What command would you use
to archive and compress “/data” in one shot?

A

tar -cvzf data.tar.gz /data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you extract a file in the same directory where the tarball is stored?

A

tar -xvf
<tarball name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you extract a file in a directory other than where the tarball is stored?

A

tar -xvf
<tarball name> -C <dump directory>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can you list the contents in a tarball?

A

tar -tf <tarball name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can we know the type of a file?

A

file <filename>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly