Archive
Last updated
Last updated
File compression is a fundamental task in managing and transferring data efficiently on a Linux system.
An archive file is a compressed file that contains one or more files bundled together for more accessible storage and portability.
Archiving commands in Linux are tools used to package and compress one or multiple files or directories into a single archive file.
The most commonly used archiving commands in Linux include tar, gzip, zip, and rar.
Archiving commands in Linux are a set of tools used to create, manage, and extract archive files.
These tools allow users to package one or more files or directories into a single archive file, compress the data, and store it in an organized and efficient manner.
They help to reduce the overall size of files and directories, making them easier to transfer and store.
tar
Used to create, manage, and extract tar archives. Tar stands for “tape archive,” which refers to its origins as a tool for backing up data to tape drives.
gzip
Used to compress and decompress files using the gzip compression algorithm. Gzip is commonly used in conjunction with tar to create tarballs, which are tar archives that have been compressed with gzip.
zip
Used to create, manage, and extract zip archives. Zip is a popular archive format that is supported by many operating systems.
rar
Used to create, manage, and extract rar archives. Rar is a proprietary archive format that supports compression, spanning, and error recovery.
tar command
This command creates a tar archive called file.tar
from the contents of the directory located at /path/to/folder
This command extracts the contents of the file.tar
archive into the current directory.
gzip commands
This command compresses a file called file.txt
and replaces it with a compressed file called file.txt.gz
.
This command decompresses a file called file.txt.gz
and replaces it with a decompressed file called file.txt
.
This command displays the contents of a compressed file called file.txt.gz
on the terminal without extracting it.
This command allows you to view the contents of a compressed file called file.txt.gz
in a more user-friendly way.
zip commands
This command creates a new zip archive called archive.zip
and adds two files called file1.txt
and file2.txt
to it.
rar commands
This command creates a new rar archive called archive.rar
and adds two files called file1.txt
and file2.txt
to it.
This command extracts the contents of the archive.rar
file into the current directory.