LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to search for a pattern of a tar ball and pipe that name to tar to extract (http://www.linuxquestions.org/questions/linux-general-1/how-to-search-for-a-pattern-of-a-tar-ball-and-pipe-that-name-to-tar-to-extract-931559/)

linux_newb 02-27-2012 09:58 AM

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.

Thanks

PTrenholme 02-27-2012 02:16 PM

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.)

linux_newb 02-27-2012 04:28 PM

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.


All times are GMT -5. The time now is 08:33 AM.