Results 1 to 3 of 3
Hello,
I am using the below tar execution, and it works fine. The question is that when I extract, I always get the full path. Is there a way to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-01-2012 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 27
Help With Tar Execution
Hello,
I am using the below tar execution, and it works fine. The question is that when I extract, I always get the full path. Is there a way to when extracting, that it only extracts the files and not include the full path to the files?
tar -cvjf backup/filename.tar.bz2 /home/virtual/domain.com/var/www/html/ > /dev/null 2>&1.
Example:
tar -xvjf filename.tar.bz2 -> extracts to html/
and not,
/home/virtual/domain.com/var/www/html/
Thanks JR
- 04-04-2012 #2Linux Enthusiast
- Join Date
- Aug 2006
- Location
- Portsmouth, UK
- Posts
- 539
man tar
You'll be wanting to look at --strip-path or --strip-components depending on the version of tar you're using.RHCE #100-015-395
Please don't PM me with questions as no reply may offend, that's what the forums are for.
- 04-04-2012 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 27
Hello,
Thank you. That works for me.
JR


Reply With Quote
