Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux tar.gz zip decompression Compression Command

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

linux tar.gz zip decompression compression command

http://apps.hi.baidu.com/share/detail/37384818

download ADT link

http://dl.google.com/android/ADT-0.9.6.zip

download SDK link

http://dl.google.com/Android/android-sdk_r11-linux_x86.tgz (You can get the specific file name through FQ, and then download it through the link)

tar

-c: Create compressed files

-x: decompression

-t: View content

-r: appends files to the end of the compressed archive file

-u: Update files in original archive

These five commands are independent, compression and decompression will use one of them, can be used with other commands but only one of them. The following parameters are optional when compressing or decompressing files as needed.

-z: with the gzip attribute

-j: with bz2 attribute

-Z: with the compression attribute

-v: Show all processes

-O: Unwrap files to standard output

The following parameter-f is required

-f: Use the file name, remember, this parameter is the last parameter, followed only by the file name.

# tar -cf all.tar *.jpg

This command is to group all.jpg files into a package called all.tar. - c is to generate a new package, and-f specifies the file name of the package.

# tar -rf all.tar *.gif

This command adds all.gif files to the all.tar package. - r means adding files.

# tar -uf all.tar logo.gif

This command updates the logo.gif file in the original tar package all.tar. -u means update file.

# tar -tf all.tar

This command lists all files in the all.tar package, -t means list files

# tar -xf all.tar

This command is to extract all files in the all.tar package, -x means to extract.

compression

tar -cvf jpg.tar *.jpg //Package all jpg files in the directory as tar.jpg

tar -czf jpg.tar.gz *.jpg //Package all jpg files in the directory into jpg.tar and compress them with gzip to generate a gzip compressed package named jpg.tar.gz

tar -cjf jpg.tar.bz2 *.jpg //Package all jpg files in the directory into jpg.tar and compress them with bzip2 to generate a bzip2 compressed package named jpg.tar.bz2

tar -cZf jpg.tar.Z *.jpg //Package all jpg files in the directory into jpg.tar and compress them with compression to generate an umcompress package named jpg.tar.Z

rar a jpg.rar *.jpg //rar format compression, you need to download rar for Linux first

zip jpg.zip *.jpg //zip format compression, you need to download zip for linux first

decompression

tar -xvf file. tar//extract tarpack

tar -xzvf file. tar. gz//extract tar.gz

tar -xjvf file.tar.bz2 //extract tar.bz2

tar -xZvf file.tar.Z //extract tar.Z

unrar e file. rar//unzip rar

unzip www.example.com//unzip file.zip

summary

1. *.tar decompresses with tar -xvf

2. *.gz unzip with gzip -d or gunzip

3. *.tar.gz and *.tgz are decompressed with tar -xzf

4. *.bz2 unzip with bzip2 -d or bunzip2

5. *.tar.bz2 Decompress with tar -xjf

6. *.Z decompresses with uncompress

7. *.tar.Z Decompress with tar -xZf

8. *.rar Decompress with unrar e

9. *.zip Unzip

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report