解压

If you want the files to be extracted to a particular destination you can add -C /destination/path/
Make sure you make the directory first, in this case: ~/Pictures/Community

mkdir ~/Pictures/Community
tar xf community_images.tar.gz -C /home/emmys/Pictures/Community/

or

tar -xvzf community_images.tar.gz -C some_custom_folder_name

f: this must be the last flag of the command, and the tar file must be immediately after. It tells tar the name and path of the compressed file.
z: tells tar to decompress the archive using gzip
x: tar can collect files or extract them. x does the latter.
v: makes tar talk a lot. Verbose output shows you all the files being extracted.

参考:
[1] https://askubuntu.com/questions/25347/what-command-do-i-need-to-unzip-extract-a-tar-gz-file

posted @ 2023-04-20 09:24  xiaoxuxli  阅读(92)  评论(0编辑  收藏  举报