In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the compression and packaging commands of files and file systems in linux. It has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
====gzip compression command ===
# gzip [-cdtv#] filename-> files that can be unzipped by compress, zip, gzip software
-c: Output compressed data to screen, which can be handled by data redirection
-d: decompression parameter
-t: Verify the consistency of a compressed file to see if the file has errors
-v: Display information such as compression ratio of source file/compressed file
-#: Compression rating,-1 fastest but worst compression ratio,-9 slowest but best compression ratio. Default-6
====bzip2 Compression Command ====
# bzip2 [-cdkzv#] filename
-c: Output the data generated during compression to the screen
-d: decompression command
-k: Keep the original file, do not delete the source file
-z: compression parameter
-v: Display information such as compression ratio of source file/compressed file
==== Compress/decompress and pack command tar===
# tar -jcvf file.tar.bz2 file1 file2 file3…-> Compression and packaging with bzip2
# tar -jxvf file.tar.bz2 -C directory-> Extract to specified folder with bzip2
# tar -jtvf file.tar.bz2-> View compressed file contents of bz2
---------------------------
# tar -zcvf file.tar.gz file1 file2 file3…-> Compression and packaging with gzip
# tar -zxvf file.tar.gz -C directory-> Use gzip to extract to specified folder
# tar -ztvf file.tar.gz-> View compressed file contents of gz
--------------------------–
-p: Keep original permissions and attributes of backup data backup (-c) important configuration files
-P: Keep absolute path, i.e. allow backup data to contain root directory existence (rarely used)
- exclude=FILE: Do not package FILE during compression
If you only want to unpack a single file, you can use the command:
# tar -jtvf file.tar.bz2| grep ‘myfile’
# tar -jxvf file.tar.bz2 File name to be solved
====dump backup complete file system ====
# dump -S /dev/sda1-> Just list how much disk space is needed to backup
# dump -0u -f /root/boot.dump /boot-> Backup level 0 means full backup, -u means and record dump time to/etc/dumpdatas file
If it is a directory rather than a single file system, it can only be backed up completely and cannot use the-u parameter, and the data that needs to be backed up is in this directory:
# dump -0j -f /root/etc.dump.bz2 /etc
===restore restore dump backup ===
# restore [-tir] -f dumpfile
# restore -C -f dumpfile -D mount point-> compare dump with actual file
-t: View dump file contents
-i: Enter interactive mode
-r: Restore of the entire file system
==== CD Writer ====
* First, build the data you need to backup into an image file (ISO), using the mkisofs command.
* Burn the image file to a CD or DVD using the cdrecord command
# mkisofs -o image file-rv -m file to backup file… -v vol -graft-point isodir=systemdir
For example: # mkisofs -r -v 'linux_file'-o /tmp/system.img -m /home/lost+found -graft-point /root=/root /home=/home /etc=/etc
Next, let's talk about the CD burning tool cdrecord
# cdrecord -scanbus dev=ATA
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.