In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article to share with you is about the Linux system in the powerful packaging command tar how to use, Xiaobian feel quite practical, so share to everyone to learn, I hope you can read this article after some gains, not much to say, follow Xiaobian to see it.
There is a very powerful packaging command in Linux system-tar, tar can package multiple files or directories into a large file command function, but also through gzip, bzIp2, xz support, let's take a look at the Linux system tar The use of the entire powerful packaging command.
1. Linux operation.tgz file 1. Extract.tgz file: (1) Extract to current folder Command: tar zxvf File name.tgz -C ./ eg:tar zxvf demo.tgz -C ./ (2) Extract to the specified folder under the command: tar zxvf filename.tgz -C /specified path eg: Extract to home directory: tar zxvf simple-examples.tgz -C /Home
Second, Linux operation.tar.gz file 1. Compression.tar.gz file command: tar -zcvf compressed file name.tar.gz compressed file name eg:tar -zcvf demo.tar.gz test2. Decompression command: command: tar -zxvf compressed file name.tar.gz -C /specified path eg:tar -zxvf demo.tar.gz -C /home Supplement: tar detailed parameters-c: create compressed archives-x: decompress-t: view contents-r: append files to the end of compressed archives-u: update files in the original compressed package
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 gzip attribute-j: with bz2 attribute-Z: with compress attribute-v: show all processes-O: unzip file 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 groups all.jpg files into a package called all.tar. -cf 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 to update the 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, -t means to extract.
Linux is a free-to-use and freely distributed UNIX-like operating system, is a POSIX-based multi-user, multitasking, multi-threaded and multi-CPU operating system, using Linux to run major Unix tools, applications and network protocols.
The above is how to use the powerful packaging command tar in Linux system. Xiaobian believes that some knowledge points may be what we will see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.