A tar
file is a form of archive, similar to the more common zip file, that compresses data and is useful for storage or transfer.
There are several options available:
-
-c
- Create a new tar file
-
-v
- Verbose mode: the command will list all the files it is acting on
-
-f
- Use specified archive file
-
-x
- Extract the content of the
tar
file
Examples:
- Creating an archive file
tar -cvf archive.tar DirectoryToArchive
- Extracting files from an archive
tar -xvf archive.tar
- Extracting specific files from an archive
tar -xvf archive.tar path/to/file/in/archive
- Listing files from the archive
tar -t archive.tar path/to/list