Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract tar file without creating folder

I want to extract tar file in Unix tar xvf /home/test/group.tar and once extracted got a folder group which has list of xls,pdf,txt files.

How can i extract contents of group.tar inside /home/test/list of xls, pdf files without creating group folder.

Any specific command available or have to follow with copy and move??

Thanks!

like image 780
Bala K Avatar asked May 15 '15 07:05

Bala K


People also ask

How do I extract the contents of a tar file?

Simply right-click the item you want to compress, mouseover compress, and choose tar. gz. You can also right-click a tar. gz file, mouseover extract, and select an option to unpack the archive.

Can you extract single file from tar?

A. GNU tar can be used to extract a single or more files from a tarball. To extract specific archive members, give their exact member names as arguments, as printed by -t option.

How do I open a tar file without extracting it?

Use -t switch with tar command to list content of a archive. tar file without actually extracting. You can see that output is pretty similar to the result of ls -l command.


1 Answers

You may use the --strip-components 1 parameter.

tar xvf group.tar --strip-components 1
like image 140
Vasilis Aivalis Avatar answered Oct 18 '22 13:10

Vasilis Aivalis