Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-20-2006, 07:37 AM   #1
Registered: Jul 2004
Distribution: Slackware, Suse
Posts: 46

Rep: Reputation: 15
(un)tar a certain directory from an archive

Hey guys,
I have a huge backup archive which contains 4 different folders. Now I only need one of the folders.
The tar file is to big to be extracted as a whole. It would take too long so how can I only extract a certain directory from a tar file?

I tried

tar xf file.tar --exlude 'directory/*' --exclude directory *

but that did not work!


Old 06-20-2006, 07:54 AM   #2
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
tar xf file.tar path/of/dir/in/archive
more generally
tar xf file.tar [fileOrDirToExtract]
Old 06-20-2006, 08:09 AM   #3
Registered: Jul 2004
Distribution: Slackware, Suse
Posts: 46

Original Poster
Rep: Reputation: 15
Thanks that's what I needed!


archive, backup, directory, folder, tar

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
old tar? archive maenho Linux - Software 4 12-14-2006 08:05 PM
tar - extracting a single directory from a large archive? lowpro2k3 Linux - General 1 07-24-2005 03:44 AM
Tar gives error when creating a tar file archive davidas Linux - Newbie 10 04-13-2004 01:35 AM
this doesn't look like a tar archive .phister Slackware 5 02-01-2004 02:19 AM
Tar archive issues yorkb Linux - Software 1 10-12-2003 06:14 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration