In: Computer Science
unix/Linux
Create a tar command using the man command and the link referred to in To Practice and Explore: Text File Utilities #9.
Preliminaries
Perform
Use tar "to stuff" three files and then "unstuff" them into a new directory. Include the -v option.
Task
he Linux 'tar' stands for tape archive, is used to create Archive and extract the Archive files. tar command in Linux is one of the important command which provides archiving functionality in Linux. We can use Linux tar command to create compressed or uncompressed Archive files and also maintain and modify them..................
Syntax:
tar [options] [archive-file] [file or directory to be archived]
Options:
-c : Creates Archive
-x : Extract the archive
-f : creates archive with given filename
-t : displays or lists files in archived
file
-u : archives and adds to an existing archive
file
-v : Displays Verbose Information
-A : Concatenates the archive files
-z : zip, tells tar command that create tar file
using gzip
-j : filter archive tar file using tbzip
-W : Verify a archive file
-r : update or add file or directory in already
existed .tar file...............
Examples:
1. Creating an uncompressed tar Archive using option -cvf
: This command creates a tar file called file.tar which is
the Archive of all .c files in current
directory.........................
$ tar cvf file.tar *.c
Output :
os2.c os3.c os4.c
2. Extracting files from Archive using option -xvf : This command extracts files from Archives.
$ tar xvf file.tar
Output :
os2.c os3.c os4.c
NAME tar - an archiving utility SYNOPSIS Traditional usage tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...] UNIX-style usage tar -A [OPTIONS] ARCHIVE ARCHIVE tar -c [-f ARCHIVE] [OPTIONS] [FILE...] tar -d [-f ARCHIVE] [OPTIONS] [FILE...] tar -t [-f ARCHIVE] [OPTIONS] [MEMBER...] tar -r [-f ARCHIVE] [OPTIONS] [FILE...] tar -u [-f ARCHIVE] [OPTIONS] [FILE...] tar -x [-f ARCHIVE] [OPTIONS] [MEMBER...] GNU-style usage tar {--catenate|--concatenate} [OPTIONS] ARCHIVE ARCHIVE tar --create [--file ARCHIVE] [OPTIONS] [FILE...] tar {--diff|--compare} [--file ARCHIVE] [OPTIONS] [FILE...] tar --delete [--file ARCHIVE] [OPTIONS] [MEMBER...] tar --append [-f ARCHIVE] [OPTIONS] [FILE...] tar --list [-f ARCHIVE] [OPTIONS] [MEMBER...] tar --test-label [--file ARCHIVE] [OPTIONS] [LABEL...] tar --update [--file ARCHIVE] [OPTIONS] [FILE...] tar --update [-f ARCHIVE] [OPTIONS] [FILE...] tar {--extract|--get} [-f ARCHIVE] [OPTIONS] [MEMBER...]
NOTE This manpage is a short description of GNU tar. For a detailed discussion, including examples and usage recommendations, refer to the GNU Tar Manual available in texinfo format. If the info reader and the tar documentation are properly installed on your system, the command info tar should give you access to the complete manual. You can also view the manual using the info mode in emacs(1), or find it in various formats online at If any discrepancies occur between this manpage and the GNU Tar Manual, the later shall be considered the authoritative source.