


Use the -v option if you want to see the files that are being processed.
#UNTAR COMMAND LINUX ARCHIVE#
The following example will create an archive named user_backup.tar of the /home/user directory: tar -cf backup.tar /home/user By default, directories are archived recursively unless -no-recursion option is specified. You can create archives from the contents of one or more directories or files. Here is the equivalent command using the long-form options: tar -create -file=archive.tar file1 file2 file3 To create a tar archive, use the -c option followed by -f and the name of the archive.įor example, to create an archive named archive.tar from the files named file1, file2, file3, you would run the following command: tar -cf archive.tar file1 file2 file3 For example, if an archive has been compressed with gzip When creating compressed tar archives, it is an accepted convention to append the compressor suffix to the archive file name. Tar supports a vast range of compression programs such as gzip, bzip2, lzip, lzma, lzop, xz and compress. The short-form options are prefixed with a single dash ( -), which can be omitted. The long-form options are prefixed with a double dash ( -).

The long forms are more readable, while the short forms are faster to type. When executing tar commands, you can use the long or the short form of the tar operations and options. If not provided, the entire archive is extracted. FILE_NAME(s) - A space-separated list of filenames to be extracted from the archive.ARCHIVE_NAME - The name of the archive.-file=archive=name ( -f archive-name) - Specifies the archive file name.-verbose ( -v) - Show the files being processed by the tar command.The most frequently used operations are: -list ( -t) - Display a list of the files included in the archive.-extract ( -x) - Extract the entire archive or one or more files from an archive.-create ( -c) - Create a new tar archive.OPERATION - Only one operation argument is allowed and required.
