Search all tar.gz files in subdirectories for file
I have subfolders of 365 tar.gz files from a webserver across the span of a year. I now need to search all of these tar.gz files for the most recent copy of a few php files. I tried this, but I'm not getting the desired results (the command comes back with Not found in archive, when I know it is):
Code:
www_backups$ tar -ztvf */www*.* | grep ".php" Code:
tar: 20120324/www-20120324.tar.gz: Not found in archive |
After the shell filename expansion, your tar command results in something like:
Code:
tar -ztvf 20120323/www-20120323.tar.gz 20120325/www-20120325.tar.gz 20120326/www-20120326.tar.gz If you want to look for a file inside multiple archives, better to use a loop, e.g. Code:
for archive in */www-*.tar.gz |
Quote:
|
All times are GMT -5. The time now is 04:23 PM. |