Extracting from Tar Balls.

Bar discussions . Talk about everything not only php !. Guests are welcome here , forum registration is not required.

Moderators: macek, egami, gesf

User avatar
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Extracting from Tar Balls.

Postby Nullsig » Fri May 11, 2012 5:03 am

So I have a tar ball (multiple actually) that hold a directory structure and all of the files contained in those directories.

I need a command that can extract all files from the tarball matching a regular expression and still preserve the directory structure so I can immediately extract them to the intended directory.


User avatar
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Extracting from Tar Balls.

Postby egami » Fri May 11, 2012 11:48 am

for file in `ls | grep -i [expression]`; do ; tar xvfz $file; done;

Return to “Free time”

Who is online

Users browsing this forum: No registered users and 3 guests