Extracting from Tar Balls.

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

Moderators: egami, macek, gesf

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

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: 2192
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Fri May 11, 2012 11:48 am

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

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest