tar Flashcards

1
Q

tar

A

GNU tar is an archiving program designed to store multiple files in a single file (an archive), and to manipulate such archives.

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

tar -cvf file.tar /home/user

A

Creates a tar archive file.

c, Creates a new .tar archive file.

v, verbose

f, File name type of archive file.

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

tar -cvzf file.tar.gz /home/user

A

Creates a compressed gzip archive file with the z option.

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

tar -cvfj file.tar.bz2 /home/user

A

Creates a highly compressed bz2 archive file by using the j option.

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

tar -xvf file.tar

A

Extracts a tar file into the current directory.

x, Extracts the tar file.

v, verbose.

f, File type archive.

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

tar -xvf file.tar -C /home/user/documents

A

Extracts a tar file into specified directory by using the -C option.

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

tar -xvf file.tar.gz

or

tar -xvf file.tar.bz2

A

Decompresses and extracts a compressed tar file to current directory.

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

tar -tvf userfiles.tar

or

tar -tvf userfiles.tar.gz

or

tar -tvf userfiles.tar.bz2

A

This command lists the contents of userfiles.tar and userfiles.tar.gz by using the -t option.

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

tar -xvf userfiles.tar userscript.sh

or

tar –extract –file=userfiles.tar userscript.sh

A

These commands will extract a single file by calling it out from the .tar file.

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

tar -zxvf userfiles.tar.gz user.doc

or

tar -jxvf userfiles.tar.bz2 user.doc

A

These commands will extract user.doc out of userfiles.tar.gz and userfiles.tar.bz2 respectively. Make sure to add the right -z or -j flags depending on the mode of compression.

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

tar -xvf serverfile.tar “file1.php” “file2.html”

or

tar -zxvf serverfile.tar.gz “file1.php” “file2.html”

or

tar -jxvf serverfile.tar.bz2 “file1.php” “file2.html”

A

These commands will untar multiple files by using quotation marks around the files.

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

tar -xvf serverfiles.tar –wildcards ‘*.php’

or

tar -zxvf serverfiles.tar.gz –wildcards ‘*.php’

or

tar -jxvf serverfiles.tar.bz2 –wildcards ‘*.php’

A

These commands will extract multiple files from the tar files and compressed tar files by using the –wildcard option and then a wildcard search in single quotes.

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

tar -rvf serverfiles.tar xyz.conf

or

tar -rvf serverfiles.tar php/

A

These commands will add a file or directory to a tar archive by using the -r option.

-r, Appends a tar file.

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

tar -rvf MyImages-14-09-12.tar.gz xyz.txt

or

tar -rvf Phpfiles-org.tar.bz2 xyz.txt

A

These commands will add files to the gzip and bzip2 files.

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

tar -tvfW serverfiles.tar

A

This command will list and verify a .tar file by using -W.

-W, Verifies a .tar file.

Note: Verifications cannot be done on a .tar file compressed by gzip or bzip2.

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