Solved

tar -zxvf syslinux-3.86.tar.gz

Posted on 2011-02-17
6
914 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

 
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

615 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