Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-03-2003, 10:30 PM   #1
Senior Member
Registered: Apr 2003
Posts: 3,679

Rep: Reputation: 55
Tar command

Hi folks

What will be the correct syntax to untar a tarball to a selected folder


Tarball in /user/download/xxx-000.tar.gz
Preferred to untar to /opt/

$ tar zxvf /user/download/xxx-000.tar.gz -C /opt/

will a directory 'xxx-000' be automatically created under /opt/xxx-000

Kindly advise.

Thanks in advance.

Old 11-03-2003, 10:44 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913
The name of the tarball does not
necessarily reflect the name or
structure of the content.

If the tarball i.e. contained just
files, no directory structure, you'd
get all files extracted to /opt

Old 11-03-2003, 11:06 PM   #3
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Try 'tar tzvf file.tar.gz' to see the contents - that'll show you the directories (if any) that will be created at and below the target directory when you actually extract it. (At least, it should - may depend on how the thing was tarred, but I think it does in all circumstances.) I need to 'man tar' on that, and you could too. *g*
Old 11-03-2003, 11:34 PM   #4
Senior Member
Registered: Apr 2003
Posts: 3,679

Original Poster
Rep: Reputation: 55
Hi all

Noted with thanks



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
Tar command juanb Linux - General 4 11-03-2005 01:10 AM
tar command? xmdms Linux - General 4 10-07-2004 02:29 PM
tar command harisankar Linux - General 2 08-02-2004 01:44 PM
tar command.. johnyy Linux - Software 4 12-31-2003 11:54 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration