In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Linux system commonly used symbols, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
There are many symbolic commands in the Linux system, they play a very important role in the Linux system, and the function is also very powerful.
1. Symbol:
In linux, & and &, | and | | are described as follows:
& indicates that the task is executed in the background. If you want to run redis-server in the background, there is redis-server &
& & indicates that the latter command is executed only when the previous command is executed successfully, such as echo'1' & & echo'2'.
| | indicates the pipe. The output of the previous command is used as the parameter of the next command, such as echo 'yes' | wc-l |
| indicates that the next command will not be executed until the previous command fails, such as cat nofile | | echo "fail"
Cd. Current directory
Cd.. Higher-level directory
Cd ~ user's home directory (root's home directory is root's home directory is home)
> overwrite and rewrite a file echo "11111" > hello (overwrite the contents of the document named hello with 11111)
> > append to a file echo "11111" > hello (append 11111 to the end of the hello document)
The symbol that serves as the function of "continuous instruction" is "semicolon" (example: cd ~ / backup; mkdir startup; cp ~ /. * startup/. Use a semicolon (;) to separate the command from the command, and the command before the semicolon will be executed immediately after the execution of the semicolon (whether successful or not).
'string' single quotation marks
Content enclosed in single quotation marks will be treated as a single string. The $symbol that represents a variable in quotation marks has no effect, that is, it is treated as a general symbol to prevent any variable substitution.
User@user-virtual-machine:~$ hey=homeeach'$hey' user@user-virtual-machine:~$ echo $hey homeeach$hey "string" double quotation marks
Content enclosed in double quotes will be treated as a single string. It prevents wildcard expansion, but allows variable expansion. This is different from the way single arguments are handled.
User@user-virtual-machine:~$ hey= "long" user@user-virtual-machine:~$ echo da $hey da long* asterisk (wild card) is a fairly common symbol. 1. On the file name extension (Filename expansion), it is used to represent 0 to infinitely many arbitrary characters.
[root@RHEL6] # ls a *
Aaa anaconda-ks.cfg
[root@RHEL6 ~] #
2. In a regular expression (Regular Expressions), a character that repeats from zero to infinity, such as: grep-n 'ess file.txt, may match es, ess, esss, and so on. 0 to infinitely many characters in a regular expression use "." It means. 3. In operation, it represents "multiplication". Let "fmult=23" in addition to the built-in instruction let, there is also an operation instruction expr, where the asterisk also plays the role of "multiplication". But be careful in use, he must be preceded by the escape character.
* * two asterisks represent the meaning of "power" in the operation. Let "sus=2**3" echo "sus= $sus" # sus= 8
$and money number (dollar sign)
1. Use the leading character of the variable, that is, the representative symbol of the variable substitution value variable substitution (Variable Substitution) that needs to be added before the variable.
[root@RHEL6 ~] # vrs=123 [root@RHEL6 ~] # echo "vrs= $vrs" vrs= 1232, which is defined as the end-of-line of the "row" in Regular Expressions. This is commonly used in grep, sed, awk, and vim (vi).
[root@RHEL6 ~] # ll | grep "txt$" / / lists the lines ending with txt-rw-r--r--. 1 root root 1700 May 21 10:50 1.txt-rw-r--r--. 1 root root 650 May 31 18:11 123.txt-rw-r--r--. 1 root root 1700 May 21 10:50 2.txt-rw-r--r--. 1 root root 923 May 27 09:20 network.txt-rw-r--r--. 1 root root 96 Jun 1 17:58 printf.txt-rw-r--r--. 1 root root 673 Jun 1 12:24 regular_express.txt3, in bash $itself is also a variable. It represents the current shell process code, that is, the so-called PID (Process ID). If you want to know our current shell PID, you can do this.
[root@RHEL6] # echo $4316 after reading the above, have you mastered the methods of common symbols in Linux system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.