Search code examples
extracttargunzip

How to extract all the .tgz files from directory


I have a directory

directory/subdir1/temp1.tgz /subdir2/temp2.tgz /subdir3/subdirectory1/temp3.tgz /subdir4/temp4.tgz

How to extract all temp files using terminal?


Solution

  • Something like can do the work:

    find directory -name "*.tgz" -type f -exec tar xzf {} \;
    

    This will extract all the files in current directory!