How to search for a pattern of a tar ball and pipe that name to tar to extract
Linux - GeneralThis 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.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Windows 7, RHEL 5.4, CENTOS 5.4, RHEL 6
Posts: 55
Rep:
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.
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.)
Distribution: Windows 7, RHEL 5.4, CENTOS 5.4, RHEL 6
Posts: 55
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.