In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "AIX how to compress and extract files", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "AIX how to compress and extract files" bar!
.gz
Gzip-d or gunzip
Gzip
.Z
Uncompress
Compress
.tar
Tar-xvf
Tar-cvf
.cpio
Cpio-idumv
.zip
Unzip or jar-xvf
* .tar.gz
Gzip-dc * .tar.gz | tar xvf-
In the application of AIX system, we often encounter compressed files or decompressed files. Here are some common compression and decompression tools and their usage.
1. Tar command: you can create archives for files and directories. Generally speaking, the tar command is responsible for packaging files or folders, but does not provide compression. In general, compression tools cannot compress folders directly, so when compressing folders, package is performed first, and then compression is performed in conjunction with other tools.
Command format:
# tar-cvf (or xvf) + file name + device
C: it's local to other devices.
X: other devices to the local
R: it is appended, for example, when packaging, append other files to use this parameter.
T: display the contents of the tar package, but restore the file.
For example:
# tar-cvf bak.tar / test/bak-package all files and folders under / test/bak into bak.tar files
# tar-rvf bak.tar / test/bak/1.txt-append / test/bak/1.tx to the bak.tar file
# tar-xvf bak.tar-restore the files in the bak.tar package.
# tar-tvf bak.tar-displays the contents of the bak.tar file.
2. Gzip command: compress or decompress the file, generate the compressed file with the suffix gz when performing the compression, and use gzip-d or gunzip to extract the file with the suffix .gz when decompressing.
For example:
# gzip bak.tar-compress bak.tar and generate bak.tar.gz files at the same time
# gzip-d bak.tar.gz-extract the bak.tar.gz file into a tar package, which needs to be restored to a file with the tar command.
# gzip-dc bak.tar.gz | tar xvf-call the tar command to extract the file with the suffix tar.gz directly into a file.
3. Compress command: compress the file and generate a compressed file with the suffix .Z
For example:
# compress test.log-compress test.log files into test.log.Z files
If you compress a folder with compress, first call tar to package the folder, and then compress it
You can use compress-d or uncompress to extract files with the suffix .Z
If the compressed file is a text file, you can use zcat to view the compressed file directly (you don't need to extract it first and then use cat)
# zcat test.log.Z-directly view the contents of the test.log.Z file
# uncompress-c bak.tar.Z | tar xvf-directly decompress the file with the suffix tar.Z
4. Bzip2 command: compress or decompress the file, and a compressed file with the suffix .bz2 will be generated when compressed.
You can use bzip2-d or gunzip2 to extract files with the suffix .bz2
# bzip2 bak.tar-compress bak.tar files with bzip2 tool
# bzip2-d bak.tar.bz2 or gunzip2 bak.tar.bz2-decompress the file with the suffix bz2
5. Unzip command: extract the file with the suffix .zip. Download tools on the Internet, some of which are files with the suffix .zip, so you need to use the unzip tool to extract them.
# unzip apache-tomcat-6.0.20.zip-decompress apache-tomcat-6.0.20.zip
Thank you for your reading, the above is the content of "how to compress and extract files from AIX". After the study of this article, I believe you have a deeper understanding of how to compress and decompress files with AIX. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.