If the leader tells you to check the company when you're off duty. Those PCs are open, one to see? NO, it's too much trouble. The following script can quickly find the surviving PC through the ICMP ping packet, it is important to note that the local
First, the questionThe question is simple, look at the following section of tmp.sh code:#!/bin/Shx= "This was theinitial value of x" while a read line; Do x= "$line" = $x/tmp/tmp's Content1,aExecute./tmp.sh, the normal x variable is
1. View memory from large to small arrangementPS-E-O "%c:%p:%z:%a" |sort-k5-nrAnalysis:-E Display Process-O display by user-defined format%c CPU%p Parent Process ID%z Virtual Memory%aSort Order Command-k5 sorted by 5th column-nr comparing numbers
There are a lot of articles on the Internet to teach you to use scheduled tasks, so other nonsense I will not say moreI here directly have sh to do timing, just a little people do not know, must use Nohup, otherwise the user exits terminal, SH task
Recently found that the date command is especially useful (not in Mac)1. Get today's date[Email protected] ~]# date +%y%m%d201411232. Get the date of a day" 2014-11-12 " +%y%m%D20141112This seems like crap, but it's okay, keep looking.3. Get a day
Wildcard characters differ from regular expressions The wildcard is the syntax that bash native supports,A regular expression is a representation of a string, and regular expressions require supported tool support toLanguage settings: Export
Experimental requirements:1. Write a login welcome script for root user, report the number of processes in the current host, the number of logged in users, and the disk usage of the root file system.2, write three scripts: Start,stop and status,
In this paper, the basic syntax of the shell is briefly recorded for future use!1. Shell variablesWhen you define a variable name without the dollar sign $, you only need to add the dollar sign before the variable name when using the variable. As1
X Shell 4 is a good terminal to log into Linux server under Windows, which is more useful than puttyX Shell 4 Below this scenario, I personally likeThe effect of writing shell scripts with vim:Follow these steps to configure:1) Save the following
In the process of writing a shell script, it is believed that you will encounter this scenario:#!/bin/sh#log_1= "xxxxxx" log_2= "yyyyyy" log_3= "zzzzzz" for num in {1..3}do log=log_$num #此时你想把log_1, log_2,log_3, these three variables The
First, about this article The monitoring system to be done requires monitoring the usage of disk space and alerting. When testing this feature, it is necessary to simulate two scenarios: one is the need to trigger the alarm mechanism when the disk
1.Shell itself is a program written in C language, it is a bridge for users to use Unix/linux, most of the user's work is done through the shell. the shell is both a command language and a programming language. as a command language, it interprets
1.#!/bin/sh Use the SH program to execute the code below#!/bin/more output the code belowThe code below the #!/bin/executable will be used as input to this program2. * Can be used to match file names, regular matches, as multiplication. * * can also
Because there is an FTP server in the work, but each build has more trouble. Then wrote a shell script, here to share the script to everyone, if in doubt, please contact qq:403182580Default Create VSFTP User: DYCPassword: DYCFTP Data storage
IntroductionShell, we often use, with its powerful features, will help us solve a lot of difficult problems. Recently encountered a problem, to run a lot of case, assuming that the serial execution, it takes a long time. Can we get them to go
List of special variables
Variable
Meaning
$
File name of the current script
$n
Arguments passed to the script or function. N is a number that represents the first few parameters. For example,
Variable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the
Script First (test example 1) #vi first.sh
1
#!/bin/bash
2
echo ' your is in first file '
q) Call another script file in the current script file? Method One: Use sourceScript second (test
Shell variables and shell Variables
Suppose we define a variable:File =/dir1/dir2/dir3/my.file.txt
You can replace $ {} with different values:$ {File # */}: Delete the first/and its left string: dir1/dir2/dir3/my.file.txt$ {File ### */}: Delete the
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