...
File archiving and compressions
tar
"Tape archive" : tape archive, can create, add to, list, and retrieve files form an archive file (a collection of files or even whole directory trees archived together as one file).Options
Most useful options:
-f | followed by name of tar-file => needs to be the last key! | -v | verbose||
-c | create archive | |||
-tx | extract filestable of contents | |||
-x | extract files | z | (de)compresses files while (un)archiving them! | |
-v | verbose | |||
-t | table of contents - lists content of tar file | -f | followed by name of tar-file | |
-t | preserves time |
Examples:
Create Create tar-file: tar -cvf cvzf tar-filename.tar filenames_to_archive
Unarchive tar-file: tar -xvf xvzf tar-filename.tar
gzip
...
/ gunzip
Compress : compress resp. expand files.
gzip gzip filename : compresses the file filename. Whenever possible, each file is replaced(!) by one with the same name and the extension .gz
gunzip filename.gz : uncompresses the gz-file again.
Good to save space!
zip
...
/ unzip
Package : package and compress resp. unarchive and uncompress (archive) files and directories.
zip zip-file.zip file/directory_list : archives and compresses all files/directories in file_list into zip-file.zip. Leaves original files untouched.
unzip zip-file.zip : unarchives and uncompresses all files/directories in zip-file.zip.
unzip zip-file.zip aaa filename : unarchives and uncompresses only file 'aaa filename' fromzip-file.zip. Wildcards can get used.
Cursor movements in command line
...