Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Help With Tar Execution


    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/ > /dev/null 2>&1.

    tar -xvjf filename.tar.bz2 -> extracts to html/

    and not,


    Thanks JR

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Portsmouth, UK
    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.

  3. #3

    Thank you. That works for me.


  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts