Output the top 10 system user names and UID numbers of the current system to the screenhead/etc/passwdString interception1${variable name: Start position: Length}echo ${variable name: Start position: Length}Variable name =${variable name: Start
Sed is a stream editor, which is a very useful tool in text processing and can be used perfectly in conjunction with regular expressions. When processing, the currently processed rows are stored in a temporary buffer called pattern space, followed
Installation of Linux systems:1.linux System Installation Method three kinds:1. Install the Linux system independently.2. Install the Linux system on the virtual machine.A. Install the virtual machine, basically go all the way down.B. Install
Restricting the shell, like Rsh and Scponly, allows the system administrator to restrict what Linux users can do, and you can create users that will be allowed to copy files through the SCP, but will not be allowed to log on to the system's command
Sort by the second character of the 1th field, if the field is only 1 characters followed by a number, the order of the letters after the normal sort of 2 charactersRepeated lines in a uniq are repeated without repeating rows, such as:1122And the
The code below, implements some common monitoring variables of the Linux system, shares to everybody @. [Email protected]#=============================# #Filename=system_monitor.SH#Author: foxsir#date: .- Geneva- the#=============================##!/
Meet
Meaning
&&
Command1 && command2: Command 1 returns True (command return value $? = = 0) after which command 2 talent is run. Can be used for if inference.CP 1.txt.. /&& echo "succes" #-->successCP 1.txt.. /&& rm-f.
The first part: expect explanationExpect allows us to automatically log on to remote machines, and can implement automatic remote execution of commands. Of course, if you use key authentication without a password, you can also implement automatic
First, the demandHere, I simplify, because this afternoon operation both texts are 10 tens of thousands of lines, but only filter out these two files contain the same or different string ppid.Two, step together1. Document HA1Abc2. Document HA2Acd3.
The definition of the shell function is almost the same as the normal C language function.function () {}The return value of the Shell function can be displayed, and if there is no return then the execution result of the last statement will be
One, read user input (1) The basic Read command accepts input from a standard input or file descriptor and assigns the received data to a variable.1 Cat read. SH 2 #!/bin/bash3# Test the Read command4echo" "5read name6echo"Hello $name "The-p
Shell script: Batch modify file name (add character in file name)The previous article on the bulk modification of the file name (the file name of the addition of characters), the work also exists such a requirement, batch modify the file name,
Stacking of commands;However, many commands do not have idempotent, and it is necessary to use program logic to determine whether the running conditions are satisfied, so as to avoid errors in their operation.To run the script:(1) Give execution
--stdin indicates that a standard input can be made with any fileExpect its main function is to add a shell to the SSH process to pass the interactive instructions.Its core is the spawn expect send setSpawn calling the command to executeExpect waits
I wrote a script quit.sh, as follows:1 #/bin/bash2 If [$#-lt 1];then3 echo "must input at least one parameter!"4 Exit 15 fi67 if [= = "Q"];then8 echo "quit!"9 echo "$ (WhoAmI) quit @ $ (date)" >>/tmp/quit.txt #这里访问了quit. txtExit 0One elseecho "Wrong
Scripting features: Batch or single SSH-free login authenticationScript scenario: When deploying a cluster, most implementations want to configure the management node with SSH-free login from the node, writing the following script to simplify the
* Represents 0 or more arbitrary characters? Represents only one arbitrary character# comment Symbols\ de-signifier symbol[[email protected] ~]# ls #1. txt #将后面内容注释 only run LS111 1.tar 3.txt Install.log yasuo.zip111.tar 1.txt anaconda-ks.cfg
Background:A lot of people have been converted from C + +, after reading the study document, stepping into a lot of pits1 assigning values to variables don't have spaces# correct a = 123 # error2 if statement [] to leave a space, the variable is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service