Archiving Flashcards
What the command to archive multiple files/directories?
tar -cf archivename file1 file2
- c create -f file
- f must be the last parameter
What is the command to archive and compress multiple files/directories?
tar -cf
-z gzip -j bzip2
What is the command to extract a compressed tar file?
tar -xf
- x extract -f file -C destination
- z gzip -j bzip2
What is the command to list the contents of a tar file without extracting it?
tar -tf
How do you zip compress a file?
zip zipfilename file1 file2
- r recursively on directories
- creates a new compressed file
How do you uncompress a zip file?
unzip
How do you gzip compress a file?
gzip
*directly compresses file in place
How do you uncompress a gzip file?
gunzip
gzip -d
How would you compress all the contents in a directory?
Create a tar archive first as directories cannot be compressed
When removing files how do you enable/disable prompt?
rm -i (prompt)
rm -f (force)
When extracting with tar, how do you compare the extracted files with the current directory?
tar -df
*enables checking what files will be changed when overwritten
What is an alternative to tar archiving?
star
*enables extraction of individual files, not installed by default
What is the command to create a star archive?
star -c -f={name} {file/directory}
i. e star -cf=file.tar directory1 file1 file2
* command options cannot be concatenated
What is the command to view the contents of a star archive?
star -t -f={name}
When extracting a star archive what is the default behaviour?
It will not overwrite identical files that are newer