archive file 1

archive file

tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

# -c: Create an archive.
# -z: Compress the archive with gzip.
# -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful.
# -f: Allows you to specify the filename of the archive.

Here is what the above code is Doing:
1. tar: The tar command stands for tape archive. It allows you to create tar archives, as well as various other kinds of manipulation.
2. -c: Create an archive.
3. -z: Compress the archive with gzip.
4. -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful.
5. -f: Allows you to specify the filename of the archive.
6. name-of-archive.tar.gz: The name of the resulting archive.
7. /path/to/directory-or-file: The directory or file that you want to compress.

Similar Posts