Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 03-15-2004, 05:36 PM   #1
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?

Old 03-15-2004, 07:54 PM   #2
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-16-2004, 12:05 AM   #3
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 351

Rep: Reputation: 78
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.


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 03: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 08:58 PM
tar help - how to tar to a different directory thick_guy_9 Linux - Software 2 03-10-2005 05:35 PM
Tar into different path dvong3 Solaris / OpenSolaris 4 11-11-2003 04:38 AM
tar a directory radnix Linux - General 5 09-08-2002 09:43 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:05 PM.

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
Open Source Consulting | Domain Registration