I have a tar backup in tape. I want exclude some files and directories while restoring the tar backup. I cannot find a command for the same in the net. Expecting some gud solution from you people.
There really isn't any good way to exclude things with tar(1). You can include complete directory trees and try to skip the ones you don't want. You could also list all of the files you want to restore by using "tv" as Hasan mentioned.
You could also use pax(1) to read your tarfile. It has a -c option to exclude patterns.
>John: you could perhaps use the -w option for tar
That might work. But you may have to have a file with the appropriate number "y" and "n" to match which file is being restored. And would tar read from stdin?
the -w option on the command line causes tar to prompt the user for each file in the archive. (although I would have expected an -i option for something like that)
regards, John K.
it would be nice if you always got a second chance