Tuesday 6 December 2016

TAR command?

It is used to Compress an Entire Directory or a Single File.

Use the following command to compress an entire directory or a single file on Linux. It’ll also compress every other directory inside a directory you specify–in other words, it works recursively.
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
Here’s what those switches actually mean:
  • -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.
tar -xvzf apps_st.tgz apps_st

It is used to extract the directory apps_st.tgz to apps_st.


No comments:

Post a Comment