In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "introduction to the usage of tar command under Linux". In daily operation, I believe many people have doubts about the introduction of tar command under Linux. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "introduction to the usage of tar command under Linux". Next, please follow the editor to study!
Tar is the most commonly used packaging and compression tool under Linux. It plays a role similar to that of WinZip or WinRAR under Windows in Linux. The following are the common command parameters of the tool and examples of its application:
Main commands:
-c create package
-x unpack
-t list the contents of the package
-r add files to the specified package
-u update the files in the package
Optional commands:
-j use bzip2 for compression or decompression when creating or unpacking a package
-z use gzip to compress or decompress when creating or unpacking a package
-Z use compress to compress or decompress when creating or unpacking a package
-f followed by the specified package file name
-v displays the packing / unpacking process
-C specifies the path after unpacking
For example:
Tar-czf tmp.tar.gz / tmp zips the "/ tmp" directory to tmp.tar.gz
Tar-xzf tmp.tar.gz-C / home unpack the tmp.tar.gz package to the "/ home" directory
Tar-t tmp.tar.gz to view file information in the tmp.tar.gz package
Tar decompression problem
As shown below, an error such as "gzip: stdin: not in gzip format" was encountered when extracting the file using tar-zxvf:
The code is as follows:
[root@DB-Server tmp] #
[root@DB-Server tmp] # tar-zxvf Percona-XtraBackup-2.2.12-r8726828-el5-x86_64-bundle.tar
Gzip: stdin: not in gzip format
Tar: Child returned status 1
Tar: Error exit delayed from previous errors
Finally found that this compression package is not compressed in gzip format, so there is no need to add z parameters, shame!
The code is as follows:
[root@DB-Server tmp] # tar-xvf Percona-XtraBackup-2.2.12-r8726828-el5-x86_64-bundle.tar percona-xtrabackup-2.2.12-1.el5.x86_64.rpmpercona-xtrabackup-debuginfo-2.2.12-1.el5.x86_64.rpmpercona-xtrabackup-test-2.2.12-1.el5.x86_64.rpmYou have new mail in / var/spool/mail/root [root@DB-Server tmp]
At this point, the study of "introduction to the usage of the tar command under Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.