Solved

tar -zxvf syslinux-3.86.tar.gz

Posted on 2011-02-17
6
905 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
route 2 traffic streams on single NIC 6 49
How to install Ubuntu 16 in DELL venue 8 pro 20 149
Can't ping New Linux Servers 40 66
Why  my code (program) build with old compiler? 11 44
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

770 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