[UNIX Tips] Learn tar utility in 5 minutes

tar is a facility in Linux that creates archived file using a set of files. One file will be created that contains all the files in it. But...

tar is a facility in Linux that creates archived file using a set of files. One file will be created that contains all the files in it. But do not get misunderstand, ".tar" file is not a compressed file. It is only a collection of files within a single uncompressed file.

TAR
1. Create tar archive
    $ tar -cf tarFileName.tar file1 file2 file3
This will create an achive named tarFileName.tar and that will include the files specified there (ie: file1, file2, file3).
2. View the list of files
    $ tar -tf tarFileName.tar
This will list the details of the files inside the archive.
3. Extract tar archive
    $ tar -xf tarFileName.tar
This will extract the archive and create the files that were inside the archive.

The above options have the meanings as:
c - create an archive
f - archive file
t - list the content of the archive
x - extract an archive

GZIP
If the file is a ".tar.gz" or ".tgz" file it is a collection of files that is compressed. To compress a file, first create the tar file then gzip the file. For using gzip the option -z has to be used with the above command.
1. Create tar archive
    $ tar -czf tarFileName.tar file1 file2 file3
Now the archive is created as a compressed file.

z - compress using gzip utility

COMMENTS

BLOGGER: 2
Loading...
Name

About,8,Adsense,3,Ant,1,Apache,2,Axis,3,Database,2,Earn Online,3,Eclipse,8,Firefox,9,Google,27,GWT,8,Hardware,3,IE,1,Internet,1,Java,48,Javascript,8,Jenkins,1,Linux,6,Miscellaneous,18,News,46,Opinion,9,PHP,1,Productivity,3,Puzzle,3,Security,3,Software,25,Sports,9,Spring,2,TDD,4,Tech,87,Tips,18,Tomcat,5,Tools,19,Tutorial,13,Ubuntu,4,Web application,12,Web Design,2,Web services,4,Windows,3,
ltr
item
digizolm12: [UNIX Tips] Learn tar utility in 5 minutes
[UNIX Tips] Learn tar utility in 5 minutes
digizolm12
https://digizolm12.blogspot.com/2006/02/unix-tips-learn-tar-utility-in-5-minutes.html
https://digizolm12.blogspot.com/
http://digizolm12.blogspot.com/
http://digizolm12.blogspot.com/2006/02/unix-tips-learn-tar-utility-in-5-minutes.html
true
1218430210337039745
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy