"Linux|.tar.gz related command examples"

Published: Wed 19 July 2017

In content.

You can play following commands using URL: https://www.phrack.org/archives/tgz/

To download archives, you can use download manager or following loop:

[code lang=text] for i in {1..69}

do

wget http://phrack.org/archive/tgz/phrack$i.tar.gz

done

[/code]

List contents of tar.gz archive

tar tvf archive.tar.gz tar ztvf archive.tar.gz

Extract contents from tar.gz archive

tar xvzf archive.tar.gz

Extract particular file from tar.gz archive

tar zxvf archive.tar.gz ./

List particular file from archive from remote url

curl -s | tar tvzf - ./

Extract particular file from archive from remote url

curl -s | tar zxvf - ./

Extract particular file from archive from remote url, print to terminal

curl -s | tar zxvf - ./ | xargs cat

Source: https://unix.stackexchange.com/questions/34008/find-a-file-within-a-tar-gz-archive https://unix.stackexchange.com/questions/61461/how-to-extract-specific-files-from-tar-gz https://askubuntu.com/questions/168795/how-do-i-extract-a-specific-file-from-a-tar-archive https://www.cyberciti.biz/faq/linux-unix-extracting-specific-files/ https://askubuntu.com/questions/168795/how-do-i-extract-a-specific-file-from-a-tar-archive http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples https://www.cyberciti.biz/faq/linux-unix-bsd-xargs-construct-argument-lists-utility/

social