In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Main options:
-c create a new archive file. Select this option if the user wants to back up a directory or some files.
-r append the file to be archived to the end of the file. For example, if the user has already backed up the file and found that there is another directory or some files that have forgotten to back up, you can use this option to append the forgotten directory or file to the backup file.
-t list the contents of the archive file to see which files have been backed up.
-u updates the file. That is, replace the original backup file with the new file, and if the file to be updated is not found in the backup file, append it to the end of the backup file.
-x release the file from the archive.
Secondary options:
-b this option is set for the tape drive, followed by a number to indicate the size of the block. the system default value is 20 (20 × 512 bytes).
-f use archives or devices, this option is usually required.
-k saves files that already exist. For example, if you restore a file, the same file will not be overwritten if you encounter the same file during the restore process.
-m when restoring files, set the modification time of all files to now.
-M creates multi-volume archives for storage on several disks.
-v report the file information processed by tar in detail. Without this option, tar does not report file information.
-w confirmation is required at every step.
-z use gzip to compress / unzip files. Add this option to compress files, but be sure to use this option to unzip files when restoring.
For example:
1. To package and archive all .txt files in the current directory to the file this.tar.gz, we can use the
Tar czvf this.tar.gz. / * .txt
two。 Extract the files in the this.tar.gz under the current directory to the current directory. We can use the
Tar xzvf this.tar.gz. /
Compression and decompression:
Tar xvf wordpress.tar # decompress files in tar format # tar-tvf myfile.tar # View the files contained in the tar file # tar cf toole.tar tool # package the tool directory as a toole.tar file # tar cfz xwyme.tar.gz tool # package the tool directory and compress it into a xwyme.tar.gz file, because the .tar file is almost uncompressed After the .tar.gz file of MT is decompressed into a .tar file, it is almost 10MB # tar jcvf / var/bak/www.tar.bz2 / var/www/ # create .tar.bz2 file High compression ratio # tar xjf www.tar.bz2 # decompress tar.bz2 format # gzip-d ge.tar.gz # decompress .tar.gz file to .tar file # unzip phpbb.zip # decompress zip file It is still a bit troublesome to compress a file in .tar.gz format under windows # bunzip2 file1.bz2 # decompress a file called 'file1.bz2' # # bzip2 file1 # compress a file called' file1' # gunzip file1.gz # decompress a file called 'file1.gz' # gzip file1 # compress a file called 'file1' # gzip-9 file1 # maximum compression # rar a file1.rar test_file # create a package called' file1.rar' # rar a file1.rar file1 file2 dir1 # compress' file1' at the same time 'file2' and directory' dir1'####rar x file1.rar # extract the rar package # unrar x file1.rar # extract the rar package # tar-cvf archive.tar file1 # create an uncompressed tarball####tar-cvf archive.tar file1 file2 dir1 # create an unzipped tarball####tar-cvf archive.tar file1 file2 dir1 # that contains' file1' Files for 'file2' and' dir1' # tar-tf archive.tar # display the contents of a package # tar-xvf archive.tar # release a package # tar-xvf archive.tar-C / tmp # release the package to the / tmp directory # tar-cvfj archive.tar.bz2 dir1 # create A compressed package in bzip2 format # tar-xvfj archive.tar.bz2 # decompress a compressed package in bzip2 format # tar-cvfz archive.tar.gz dir1 # create a compressed package in gzip format # tar-xvfz archive.tar.gz # decompress a compressed package in gzip format # zip file1.zip file1 # Zip format archive # zip-r file1.zip file1 file2 dir1 # compress several files and directories into a single zip format package # unzip file1.zip # decompress a zip format package #
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.