LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-15-2004, 04:36 PM   #1
scatterbrain
LQ Newbie
 
Registered: Feb 2004
Location: Toronto, Canada
Distribution: Slackware 10.0
Posts: 12

Rep: Reputation: 0
tar with directory path


Hi: how do I create a tar file with a directory path, so that when its extracted it'll create the directory path I specify and place the files in it?

Thanks
 
Old 03-15-2004, 06:54 PM   #2
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Not sure if you can create directories with tar.
I'd say either put the directory tree within the tar file, or do "mkdir -p /path/to/new/directory" and extract into the new directory tree.
 
Old 03-15-2004, 11:05 PM   #3
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 250

Rep: Reputation: 43
tar --help
is pretty useful.

Somewhere in that it says...
-P, --absolute-names don't strip leading `/'s from file names

Don't forget if you exclude the directories when you create the tar ball, they won't be created when your extract the files.
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TAR Archive file - need relative path cmd0a0 Linux - Software 2 10-19-2005 02:57 PM
How to rsynce the actual directory path instead of just the directory at the end of Niceman2005 Linux - General 5 04-08-2005 07:58 PM
tar help - how to tar to a different directory thick_guy_9 Linux - Software 2 03-10-2005 04:35 PM
Tar into different path dvong3 Solaris / OpenSolaris 4 11-11-2003 03:38 AM
tar a directory radnix Linux - General 5 09-08-2002 08:43 AM


All times are GMT -5. The time now is 01:06 PM.

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