Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
aus tar-Archiv einzelnes Verzeichnis extrahieren
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
wuschel
Apprentice
Apprentice


Joined: 27 Dec 2002
Posts: 177
Location: Rodenbach, Germany

PostPosted: Sun Aug 21, 2005 6:21 pm    Post subject: aus tar-Archiv einzelnes Verzeichnis extrahieren Reply with quote

Hallo *,

ich habe ein ziemlich großes tar.bz2-Archiv (>3GB), aus dem ich nur ein bestimmtes Verzeichnis von vielleicht 50KB raus haben will.

Um nicht immer ewig zu warten obs klappt habe ich mir eine kleine Test-tar erstellt.
Wenn ich nun einfach den Verzeichnis-Namen eingebe:
Code:
tar xvf test.tar "ordner"
oder tar xvf test.tar "ordner/"
oder tar xvf test.tar "ordner/*"

...funzt es nicht.

Es gelingt mir nur, indem ich den kompletten Dateinamen mit vollständigem Pfad eingebe.
Habt ihr ne Idee, ob das evtl. doch auch so geht, indem man nur den Verzeichnisnamen eingibt?

thx
wuschel
_________________
Never run a changing system!
Epox 8rda+ (NForce2), Barton2500, 1GB, Sapphire ATI Radeon 9500Pro, WD800JB
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1591

PostPosted: Mon Aug 22, 2005 1:42 pm    Post subject: Reply with quote

Hi,

nehmen wir mal an, du hast diese Verzeichnisstruktur mit den beiden Inhalten:

ordner/ordner1 --------> mit der datei-die-ich-haben-will
!
!
!--------------------------->datei-die-nicht-extrahiert-werden-soll

Dann erstellst du dein Archiv mit:
Code:

tar cvf test.tar ordner


Zum ansehen des Archivs wählst du:
Code:

tar -tf test.tar


Um die datei-die-ich-haben-will zu extrahieren:
Code:
 tar xvf test.tar "ordner/ordner1/*"

ergiebt die Vollzugsmeldung:
Code:

ordner/ordner1/datei-die-ich-haben-will

Auf die Anführungszeichen kann man auch verzichten. Die Angabe des Pfades ist unerläßlich, damit soll ein unkontrolliertes Schreiben in das locale Verzeichnis verhindert werden.
_________________
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum