Sunday, April 28, 2024
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 4169  / 1 Year ago, sat, march 25, 2023, 8:49:46

The Situation



I am extracting a CMS from drupal-7.15.tar.gz to /var/www.



When extracted normally (with tar -xvzf filename.tar.gz) the files end up in /var/www/drupal-7.15/



The Goal



I want the contents from the archived drupal-7.15/ directory to extract directly into /var/www


More From » command-line

 Answers
5

Use



 tar -xvzf filename.tar.gz --strip-components=1


--strip-components=1 tells tar to strip the first path component (the drupal-7.15/ in your case) from each file when unpacking.


[#35443] Sunday, March 26, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
guialk

Total Points: 300
Total Questions: 144
Total Answers: 121

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
;