Archiving Flashcards

1
Q

What the command to archive multiple files/directories?

A

tar -cf archivename file1 file2

  • c create -f file
  • f must be the last parameter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the command to archive and compress multiple files/directories?

A

tar -cf

-z gzip -j bzip2

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

What is the command to extract a compressed tar file?

A

tar -xf

  • x extract -f file -C destination
  • z gzip -j bzip2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the command to list the contents of a tar file without extracting it?

A

tar -tf

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

How do you zip compress a file?

A

zip zipfilename file1 file2

  • r recursively on directories
  • creates a new compressed file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you uncompress a zip file?

A

unzip

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

How do you gzip compress a file?

A

gzip

*directly compresses file in place

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

How do you uncompress a gzip file?

A

gunzip

gzip -d

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

How would you compress all the contents in a directory?

A

Create a tar archive first as directories cannot be compressed

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

When removing files how do you enable/disable prompt?

A

rm -i (prompt)

rm -f (force)

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

When extracting with tar, how do you compare the extracted files with the current directory?

A

tar -df

*enables checking what files will be changed when overwritten

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

What is an alternative to tar archiving?

A

star

*enables extraction of individual files, not installed by default

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

What is the command to create a star archive?

A

star -c -f={name} {file/directory}

i. e star -cf=file.tar directory1 file1 file2
* command options cannot be concatenated

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

What is the command to view the contents of a star archive?

A

star -t -f={name}

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

When extracting a star archive what is the default behaviour?

A

It will not overwrite identical files that are newer

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

What is the command to extract a star archive?

A

star -x -f={name}

17
Q

How do you use star to extract specific files?

A

star -x -f={name} {file1} {file2}

*specify files to be extracted