Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-27-2012, 09:58 AM   #1
Registered: Aug 2009
Distribution: Windows 7, RHEL 5.4, CENTOS 5.4, RHEL 6
Posts: 55

Rep: Reputation: 15
How to search for a pattern of a tar ball and pipe that name to tar to extract

Hi Guys,

I want to be able to extract a tarball without typing in the entire name of the archive. The name is something like foobarchive9.9.tgz. Is there anyway I can extract that tarball just using foobarch instead of spelling out the entire name? Any help or examples will greatly be appreciated.

Old 02-27-2012, 02:16 PM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
I'm not sure what you're asking, but, if you're at a command prompt, then the <tab> key can usually be used to "complete" the command with a matching file name. So, for example, tar -xvf foob<tab> should be all you need to type. (If more than one file name matches the foob, the first <tab> will do nothing, and a second <tab> will list all matching file names.)
Old 02-27-2012, 04:28 PM   #3
Registered: Aug 2009
Distribution: Windows 7, RHEL 5.4, CENTOS 5.4, RHEL 6
Posts: 55

Original Poster
Rep: Reputation: 15
Hi Thanks for the reply. I guess i just need a way to extract a file without typing the whole name and just use some type of wildcard such as :

tar xzvf foobar**.tgz and it will extract the file based off of the matching characters. There has to be a way to do this but I just can't find anything.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with tar ball noelc Linux - Software 6 09-26-2009 04:06 AM
How to extract and install from .tar.gz and .tar.bz2 wstay Linux - Newbie 4 11-08-2008 10:14 AM
how to do a tar extract | create pipe on the fly? jjalocha Linux - General 5 12-29-2007 08:50 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:52 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