How do I exclude absolute paths for tar?

If you want to remove the first n leading components of the file name, you need strip-components. So in your case, on extraction, do

tar xvf tarname.tar --strip-components=2

The man page has a list of tar‘s many options, including this one. Some earlier versions of tar use --strip-path for this operation instead.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)