LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   tar with directory path (https://www.linuxquestions.org/questions/linux-general-1/tar-with-directory-path-158104/)

scatterbrain 03-15-2004 04:36 PM

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

mikshaw 03-15-2004 06:54 PM

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.

cyent 03-15-2004 11:05 PM

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.


All times are GMT -5. The time now is 02:35 PM.