On Fri, Aug 15, 2003 at 12:12:35AM +0530, USM Bish wrote: >On Thu, Aug 14, 2003 at 01:42:37PM +0530, G.Vinubalaji wrote: >> >> Is it possible to extract all files and directories from the >> the tar.gz file except for a list of specified files? Checked >> out the man and info pages of tar and could not find info for >> that. It does have an option to extract a list of specific >> files. > >o AFAIK, there is no switch within tar to do such a thing. > >o I have done the following thing in the past to achieve exactly > what you are looking for. It is a multi-stage process. It is > based on the -T (--from-file) switch: > > 1. tar -tzvf filename.tar.gz | cut -b 52- > tar.lst > 2. vi tar.lst [exclude dir entries and files not needed] > 3. tar -xzvf filename.tar.gz -T tar.lst
You can create a file (say named 'filelist') which contains the names of files which you want to exclude while extracting. Than you can use the -X option of tar tar -X <'filelist'> -zxvf t.tar.gz Peace -- Rajesh : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Keeping processes running LOST #280 To make a background process keep running even after a user disconnects or logs out $nohup <program-name> & ####[ajitabhpandey (at) users.sourceforge.net]################ : ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
