Compression

tar [main option + auxiliary option] file or directory

tar -czvf elephdev.tar.gz /data/elephdev
tar -cjvf elephdev.tar.bz2 /data/elephdev

unzip

tar -xzvf elephdev.tar.gz
tar -xjvf elephdev.tar.bz2

Common options

  • -x: Release files from archive files.

  • -c: Create a new archive file. If the user wants to back up a directory or some files, he must select this option.

  • -r: append the file to be archived to the end of the archive file. For example, the user has already made a backup file, and found that there is still a directory or some files that have forgotten to back up. At this time, you can use this option to append the forgotten directory or file to the backup file.

  • -t: List the contents of the archive file, check which files have been backed up.

  • -u: Update files. That is to say, replace the original backup file with the newly added file, and if the file to be updated is not found in the backup file, it will be appended to the end of the backup file.

  • -j: on behalf of the use of ‘bzip2’ program for file compression tar.bz2

  • -z: Use gzip to compress/decompress files. After adding this option, archive files can be compressed, but you must also use this option to decompress when restoring. tar.gz

  • -v: Report the file information processed by tar in detail. Without this option, tar does not report file information.

  • -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 archive files or equipment, this option is usually required.

  • -k: Save existing files. For example, if a file is restored, the same file will not be overwritten during the restoration process.

  • -m: When restoring files, set the modification time of all files to.

  • -M: Create multi-volume archive files to store in several disks.

  • -w: Confirmation is required at every step.

点赞(0)

评论列表 共有 0 评论

暂无评论

微信服务号

微信客服

淘宝店铺

support@elephdev.com

发表
评论
Go
顶部