Solved

tar -zxvf syslinux-3.86.tar.gz

Posted on 2011-02-17
6
889 Views
Last Modified: 2012-06-27
what is purpose of tar, and what are alternatives

tar -zxvf syslinux-3.86.tar.gz

what will above command do ?
0
Comment
Question by:aashee
6 Comments
 
LVL 19

Expert Comment

by:simon3270
ID: 34915625
The above command will make the /usr/src/redhat/SPECS directory, creating any directories required (e.g. if /usr/src exists but /usr/src/redhat doesn't, it will create /usr/src/redhat then create /usr/src/redhat/SPECS)

The flag is -p, not -P.

With "-p" there is no error if the directory already exists (without "-p", mkdir will print an error message if the directory already exists).
0
 
LVL 5

Expert Comment

by:sreedhar2u
ID: 34915658
tar is an archiving utility which stores files from a tape or disk archive

-z to unzip the .gz extension files
-x to extract files from an archive
-v to verbosely list files processed
-f use an archive file

tar is like a winzip in windows.
0
 
LVL 19

Accepted Solution

by:
simon3270 earned 500 total points
ID: 34915695
Oops, wrong question!

As for the above question, 2tar" is an archiver - it collects multiple files within one archive file, so that the single file can be backed up, or copied to anoter machine.  Later on, individual files within the archive, or the entire archive, can be extract to the same place on the same machine, in a different place on the same machine, or on a different machine.

Alternatives are cpio and zip.  cpio is more efficient at saving small files than tar, and allows more flexibilty in selecting the list of files to be archived.  zip is portable (to a certain extent) between UNIX and Windows.

As for the above command, it will extract all files from the syslinux-3.86.tar.gz archive file, using the same directory structure as when the archive was created.  The "z" flag tells tar that the archive is compressed with gzip (it would be "j" for archives compressed with bzip2).  "x" tells it to extract the files (as opposed to "c" when creating archives, or "t" when checking the validity of an archive file). "v" tells tar to list out the names of files as it extracts them.  "f" tells tar that the folowing word on the command line is the name of the archive to be processed.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 12

Expert Comment

by:upanwar
ID: 34916152
"man tar" would be the great help.
0
 

Author Comment

by:aashee
ID: 34916303
thanks a lot for u guys.

how can we find out that archive was compressed with bizp2 and to use j option not the z ?
0
 
LVL 19

Expert Comment

by:simon3270
ID: 34916754
You might be able to tell from the filename - if it ends .tar.bz2, then it was probably bzip2, but there is no guarantee.  The person creating the file can call it whatever they want!

Your best bet is
file syslinux-3.86.tar.gz

Open in new window

this might return:
syslinux.tar.bz2: bzip2 compressed data, block size = 900k
syslinux.tar.tgz: gzip compressed data
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now