PDA

View Full Version : tar question



youhaodeyi
23rd September 2008, 03:19 AM
I use this command to make a tar file:

tar -cvf test.tar /tmp/test

The content of test.tar will include the directory /temp/ which is not what I want. How can I only package the test directory without the /tmp path?

Seve
23rd September 2008, 03:32 AM
Hello:

cd /tmp
then
tar -cjf test.tar test/
or
tar -C tmp -cjf test.tar test/

Seve

youhaodeyi
23rd September 2008, 03:36 AM
ok thanks.