Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Hi is possible to restore a single file from the .tar backup ? I dont want to restore total backup . i just want to restore one single file from the backup .

share|improve this question
add comment

1 Answer

up vote 15 down vote accepted

1. Using the Command-line tar

Yes, just give the full stored path of the file after the tarball name.

Example: suppose you want file etc/apt/sources.list from etc.tar:

tar -xf etc.tar etc/apt/sources.list

Will extract sources.list and create directories etc/apt under the current directory.

  • You can use the -t listing option instead of -x, maybe along with grep, to find the path of the file you want
  • You can also extract a single directory
  • tar has other options like --wildcards, etc. for more advanced partial extraction scenarios; see man tar

2. Extract it with the Archive Manager

Open the tar in Archive Manager from Nautilus, go down into the folder hierarchy to find the file you need, and extract it.

  • On a server or command-line system, use a text-based file manager such as Midnight Commander (mc) to accomplish the same.

3. Using Nautilus/Archive-Mounter

Right-click the tar in Nautilus, and select Open with ArchiveMounter.

The tar will now appear similar to a removable drive on the left, and you can explore/navigate it like a normal drive and drag/copy/paste any file(s) you need to any destination.

share|improve this answer
    
Is there some way to skip the first initial directory. Especially when I don't know the name of it? Like a like wildcard directory. –  CMCDragonkai Jan 17 at 8:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.