Results 1 to 3 of 3
I downloaded a little package from the 'net. I tried to extract ONE member (one file) from the archive and place it in a different directory (a directory other than ...
- 08-27-2007 #1
help with 'tar'
I downloaded a little package from the 'net. I tried to extract ONE member (one file) from the archive and place it in a different directory (a directory other than the current one).
felipe@anarchy:~> tar -tf bitflu-current.tgz
bitflu.pl
plugins/
plugins/Bitflu/
plugins/Bitflu/StorageFarabDb.pm
plugins/Bitflu/Cron.pm
plugins/Bitflu/DownloadHTTP.pm
plugins/Bitflu/DownloadBitTorrent.pm
plugins/Bitflu/AdminTelnet.pm
plugins/Bitflu/SourcesBitTorrent.pm
felipe@anarchy:~>tar -xzf bitflu-current.tgz bitflu.pl -C ./bin/
Instead of putting the file in ./bin/ it put it in ./ (current dir) instead. I can't seem to make it put 'bitflu.pl' into ./bin/
I read through info tar and man tar but I didn't find answers to my Q. Obviously I can just user 'mv' to move it to ./bin, but that's not quite the point. I want to learn how to do this properly, using native 'tar' commands.
Any help is appreciated.
tar version: tar-1.15.1-42.2@i586 opensuse 10.2
- 08-27-2007 #2Linux User
- Join Date
- Jan 2007
- Location
- cleveland
- Posts
- 452
> I can't seem to make it put 'bitflu.pl' into
> ./bin/
try the -O switch (save to stdout) then redirect:
tar <blah,blah,blah> -O >./bin/bitflu.plthe sun is new every day (heraclitus)
- 09-08-2007 #3
I solved it:
WRONG WAY:
tar -xzf bitflu-current.tgz bitflu.pl -C ./bin/
RIGHT WAY:
tar -xzf bitflu-current.tgz -C ./bin bitflu.pl
The "-C" has to happen BEFORE extracting the tar member.
-that is all


Reply With Quote