I had made a tar backup(backup.tar.gz) in Ubuntu 16.04 and I want to restore a specific directory (/usr/share) what should I do ?

1 Answer 1


You can restore specific directory by following command -

tar -xvpzf path_to_backup backup.tar.gz directorypath_you_want_to_extract -C /

Note if directory you want to extract is /home/Downloads and backup path is /backup.tar.gz then remove the beginning /.

i.e. tar -xvpzf backup.tar.gz home/Downloads -C / and that's it .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .