In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "installation and use of rar and unrar commands in Linux VPS". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "the installation and use of rar and unrar commands in Linux VPS".
Installation:
If you are installing in the form of tarball, go to the rar website to download the corresponding version of tarball. The address is http://www.rarlab.com/
Take version 3.8 as an example, if it is an i386 platform, execute the following command:
# wget http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz
The rar software does not need to be installed and is directly decompressed to / usr/local. Root permission is required for the following operations.
# tar zxvf rarlinux-3.8.0.tar.gz-C / usr/local
At this point, there are rar commands and unrar commands under / usr/local/rar. You can create a connection under / usr/local/bin
# ln-s / usr/local/rar/rar / usr/local/bin/rar
# ln-s / usr/local/rar/unrar / usr/local/bin/unrar
If it is debian or unbuntu, you can install it automatically using the following command.
$sudo apt-get install rar
$sudo apt-get install unrar
Use:
You can use the help command or check the man documentation to learn about the use of the rar command. The following is the help document for my translation. As my English proficiency is limited, please point out the mistakes.
$rar-help
Usage: rar--
An add files to the compressed file
C add compressed archive comments (the maximum size of comments cannot exceed 62000 bytes)
Cf add file comments (file comments are displayed when the'v 'parameter is used, the maximum is not more than 32767 bytes)
Ch changes compressed file parameters
Cw writes archive comments to the specified file
D Delete a file from the file
E extract the files to the current directory (no subdirectories are created)
F refresh the files in the file (update the changes made by these files since they were packaged and do not add new ones to the compressed file)
I [par] = find specific characters in the file
K Lock the file (any command that attempts to change the contents of the compressed file will be ignored)
L [ttraining b] list files [technical, bare]
M [f] move to a compressed file [for files only]
P print file to standard output
R repair compressed files
Rc rebuilds lost volumes
Rn renames a file in a compressed file
Rr [N] add data recovery record
Rv [N] create recovery Volume
S [name | -] conversion between compressed files and SFX (self-extracting documents)
T test compressed file
U update the files in the compressed file
V [tPowerb] lists the details of the compressed file [technical,bare]
X decompress to full path
-stop scanning options
Ad appends the file name to the target path
Ag [format] generates compressed file names using current data
Ap sets the path inside the file
As synchronizes the directory in the file
Av sets authentication detection (this feature is available only in the registered version)
Av- turns off authentication detection
C-turn off the display of comments
Cfg- turns off read settings
Cl converts names to lowercase letters
Cu converts names to uppercase letters
Delete the original file after df compression
Dh opens a shared file
Ds turns off the sorting of names for solid files
Erase files after dw compression
E [+] sets file exclusion and inclusion properties
Ed does not add empty directories
En does not set archive end block
The ep name does not contain a path
The basic file directory is not included in the ep1 name
Ep3 deployment path to fully included drive name
F refresh files
Hp [password] encrypts file data and file headers
Id [cMagnedPreceQ] shutdown message
Ierr sends all messages to standard error output
Ilog [name] logs errors to a file (only the registered version provides this feature)
Inul closes all messages
Isnd turns on the sound
K lock compressed files
Kb keeps extracted corrupted files
M sets the compression level (0-Storage … 3-default … 5-Max)
Mc sets advanced compression parameters
Md Dictionary size in KB (64, 128, 256, 512, 1024, 2048, 4096, or Amurg)
Ms [ext;ext] stores the specified file type
N contains only the specified file
N @ reads the file name into the inclusion from standard input
N @ includes the file in the specified list file
Oo [+ | -] sets the rewrite mode
Ol saves symbolic links for files as connections
Or automatically renames files
Owners and groups of live storage files saved by ow
P [password] set password
P-do not ask for password
R Recursive operation on subdirectories
R0 recursively operates on subdirectories with wildcard names only
Rr [N] add data recovery record
Rv [N] create recovery
S [, v [-], e] create solid file compression
S-turn off solid file compression
Sc [obj] sets the specified string
Sfx [name] create SFX file
Si [name] reads data from standard input
The size of the file processed by sl is less than the specified value
The file size processed by sm is larger than the specified value.
T compressed test file
Ta handles files with modified dates after the specified date. Format: YYYYMMDDHHMMSS
Tb handles files whose modification date is before the specified date, format: YYYYMMDDHHMMSS
The original time when tk kept the file
Tl sets the archive time to the most recent file time
Tn processes files newer than the specified time
To processes files that are older than the specified time
Ts [N] Save or save file time (modify, create, access)
U update file
V create automatic-sized volumes or list all volumes
V [k size=*1000 b] create a volume of specified size [* 1024, * 1]
Ver [n] file version control
Vn uses the old volume naming system
Vp pauses before each volume
W specify working directory
X exclude specified files
X@ excludes file names read from standard input
X@ specifies the file to exclude from the specified list file
Y set all answers to yes
Z [file] read notes for compressed files from the file
Note: the part of the rar does not have a "-" sign, only part of it has a "-" sign. Note this.
Example 1: add a file or directory to a compressed file, use the a command. For example, add the file files1 to the abc.rar, use the an or m command, the a command adds the file1 file to the abc.rar file to keep the original file1 file unchanged, and the m command moves the file1 file to the file1.rar file (the original file1 file will be deleted after compression is completed. Note: the m command operates only on files)
$rar an abc.rar file1
Note: if the abc.rar file does not exist at this time, the abc.rar file will be created. If the abc.rar file already exists, the file1 file will be compressed into the abc.rar file. If a file1 file already exists in the abc.rar file, the file1 file will be updated. And the original file1 file still exists in the current directory, to move the file1 file to file1.rar, use the m command, and you can do the same for the directory.
Note: if you enter only the "rar a file1.rar" command without the file or directory name, all files and folders in the current directory will be compressed into the file1.rar document. We should pay attention to this point.
Example 2: to extract the contents of the abc.rar file, you can use the e or x command. Suppose there is a file named file1 and a directory named test in the abc.rar directory, and a file named file2 in the test directory.
$rar e abc.rar
Note: using the e command, the file1 file in abc.rar will be extracted together with the file2 file in the test directory to the current directory. Use the x command if you want to maintain the directory structure in the abc.rar directory.
$rar x abc.rar
Note: the file1 file and the test directory will be unzipped to the current folder.
Example 3: add comments to the entire compressed file
$rar c abc.rar
Description: after entering this command, the bottom of the screen will be displayed.
Processing archive test.
RarReading comment from stdin
And there is a cursor flashing, enter the comment information from the position where the cursor flashes, and then press Ctrl+D to end the input.
Example 4: add comments to a single file in a compressed file, using the cf command. If you want to add comments to the file1 file in the abc.rar archive now
$rar ch abc.rar file1
The bottom of the screen will be displayed.
Reading comment for abc.rar: file1 from stdin
Flash from the cursor to enter the comments you want to add to file1, and Ctrl+D ends the entry
Example 5: write comments for the entire file to a file, using the cw command. Add the comments you want to write abc.rar to the test.txt file
$rar cw abc.rar test.txt
Note: if a file named test.txt does not exist in the current directory, a file named test.txt will be created and the comments of abc.rar will be written to the text.txt file. If a file named text.txt already exists in the current directory, you will be prompted whether to overwrite the existing file. If you select Yes or All, the original contents of the test.txt will be cleared. The comments for abc.rar are then written to the text.txt file.
Example 6: delete a file or directory in a compressed file and use the d command. For example, to delete the file1 file in the abc.rar archive.
$rar d abc.rar file1
Description: this command deletes the file1 file in the abc.rar file, which is also valid for directories.
The above are commonly used compression and decompression commands, some of the use is no longer introduced, please try it yourself.
Use of the extract command unrar:
$unrar-help
Usage: unrar--
E extract the file to the current directory
L [tPowerb] lists compressed document information [technical, bare]
P print file to standard output
T test compress me, Audang.
V [tPowerb] lists the details of the compressed document [technical,bare]
X extract the file to the full path
The following is a part, omitted.
The commands of unrar have the same effect as rar. You can see that unrar contains only some of the commands of rar, so you can do everything with rar.
At this point, I believe you have a deeper understanding of "the installation and use of rar and unrar commands in Linux VPS". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.