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 > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "the summary of the usage of tar and rar commands in Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the summary of the usage of tar and rar commands in Linux.
Tar
Tar command: used to compress and extract files. Tar itself does not have compression capabilities. It is implemented by calling the compression function.
Main mode of operation:
-A,-- catenate,-- concatenate append tar files to the archive
-c,-- create creates a new archive
-d,-- diff,-- compare find out the difference between archiving and file system
-- delete from Archive (not on tape!) Delete in
-r,-- append appends the file to the end of the archive
-t,-- list lists the contents of the archive
-- test-label test archive volume label and exit
-u,-- update appends only files that are newer than the copy in the archive
-x,-- extract,-- get unpack the file from the archive
Action modifier:
-- check-device checks the device number when creating an incremental archive (default)
-g,-- listed-incremental= files handle incremental backups in the new GNU format
-G,-- incremental handles incremental backups in the old GNU format
-- ignore-failed-read do not exit with a non-zero value when you encounter an unreadable file
-n,-- seek archives can be retrieved
-- no-check-device do not check the device number when creating incremental archives
-- occurrence [= NUMBER] handles only the NUMBER event of each file in the archive; only with the following subcommand-- delete
This option is valid only when one of-- diff,-- extract, or-- list is used together. And no matter whether the list of files is given on the command line or through
Specified by the-T option; the NUMBER value defaults to 1
-- discrete format version used for sparse-version=MAJOR [.minor] settings (implied-- sparse)
-S,-- sparse efficient processing of discrete files
Rewrite control:
-k,-- do not replace existing files when keep-old-files is decompressed
-- keep-newer-files do not replace existing files that are newer than the copy in the archive
-- no-overwrite-dir retains the metadata of existing directories
-- rewrite existing files when overwrite is decompressed
-- overwrite the metadata of an existing directory when overwrite-dir is decompressed (default)
-- recursive-unlink clears the directory hierarchy before decompressing the directory
-- remove-files deletes files after adding them to the archive
-U,-- unlink-first deletes files to be rewritten before decompressing them
-W,-- verify attempts to verify the archive after writing
Select the output stream:
-- ignore-command-error ignores the exit code of the child process
-- no-ignore-command-error considers the non-zero exit code of the child process to have an error
-O,-- to-stdout unzips the file to standard output
-- to-command=COMMAND transfers the extracted files to another program through a pipeline
Manipulate file properties:
-- atime-preserve [= METHOD] retains access time on the output file, or by reading (default)
METHOD='replace'), or do not set the time for the first time (METHOD='system')
-- delay-directory-restore does not set the modification time and permissions of the extracted directory until the decompression is finished.
-- group= name forces NAME as the group owner of the file being added
-- mode=CHANGES forces the added file (symbol) to be changed to permission CHANGES
-- mtime=DATE-OR-FILE sets mtime for added files from DATE-OR-FILE
-m,-- touch do not extract the modification time of the file
-- no-delay-directory-restore cancel-- effect of the delay-directory-restore option
-- no-same-owner unzips the file for you
-- no-same-permissions uses the user's mask bits when decompressing permissions from the archive (default is normal user service)
-- numeric-owner always represents the name of a user / group with a number
-- owner= name forces NAME as the owner of the added file
-p,-- preserve-permissions,-- same-permissions decompress file permission information (default is for superuser service only)
-- preserve is the same as-p and-s
-- same-owner maintains a consistent owner relationship when trying to decompress
-s,-- preserve-order,-- same-order sort names for unzipped to matching archives
Device selection and switching:
-f,-- file=ARCHIVE uses archived files or ARCHIVE devices
-- force-local treats the archive file as a local archive even if it has a copy
-F,-- info-script= name,-- new-volume-script= name runs the script at the end of each tape (implied-M)
-L,-- change the tape after tape-length=NUMBER writes NUMBER × 1024 bytes
-M,-- multi-volume create / list / extract multi-volume archive files
-- rmt-command=COMMAND uses the specified rmt COMMAND instead of rmt
-- rsh-command=COMMAND uses remote COMMAND instead of rsh
-- volno-file= file uses / updates the number of volumes in FILE
Equipment is divided into blocks:
-b,-- blocking-factor=BLOCKS BLOCKS x 512 bytes per record
-B,-- read-full-records is re-chunked when read (valid for 4.2BSD pipes only)
-I,-- ignore-zeros ignores zero-byte blocks in the archive (that is, the end of the file)
-- record-size=NUMBER the number of bytes per record NUMBER, multiplied by 512
Select the archive format:
-H,-- format=FORMAT creates an archive in the specified format
FORMAT is one of the following formats:
Gnu GNU tar 1.13.x format
Oldgnu GNU format as per tar
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.