Tar

    Extract specific file

    tar xvf tarball.tar path/to/file
    

    source

    Extract into a directory

    tar xvf tarball.tar -C dest_dir
    

    Flat extraction (remove first directory)

    tar xvf tarball.tar --strip-components=1
    

    Search a file

    tar tf archive.tar | grep file
    

    Search if a string is present into files of multiple archives

    find . -name \*.tar.gz -print0 | xargs -0 zgrep "STRING"
    

    source

    Original size of a file (with no unzip)

    tar ztvf archive.tar.gz -v --wildcards '*file.txt'