Files
MarkdownNotes/tar without paths.md
2023-04-26 09:27:33 -04:00

514 B

tar without paths

linux - tar - Remove leading directory components on extraction - Server Fault

You want to use the --strip-components=NUMBER option of tar:

 --strip-components=NUMBER

strip NUMBER leading components from file names on extraction

Your command would be:

tar xfz /var/www/site.gz --strip-components=2 -C /tmp

Reference