Uptime command:-* Use the uptime command to get host run time and query Linux system load information. The information is displayed in the following order: Now time, the system has elapsed time, the current number of landing users, the system in the
Recently, to the internal network for debugging and access, bought 3 peanuts can only map 6 ports, is not enough to meet the needs, just have a friend to me said Ngrok can also be carried through the intranet, research for a few days, light
Recently, when customizing ISO, there is a need for specific projects to run with a specific user, to remove root permissions. This requires creating a group of users by default based on the project. So I wrote a simple script to automatically add
in industrial applications, some files from industrial equipment will be placed in the specified directory, as these files need to be reformatted before being processed by higher-level software. At this point the processing of the script is
Finally, came to the Shell 13 ask the last question ... Long Breath ~ ~ ~ ~ ~
The last thing to introduce is a common "loop" in shell script design.
The so-called loop is the code in the script that repeats itself under certain conditions.
The
Shell if judge commonly used in the green part, the tail part of the more do not understand. Reproduced from Baidu Library.
[-A file] if FILE existence is true.
[-B-file] True if file exists and is a block-specific file.
[-C file] is true if file
Problem background:
#!/bin/shphp=100;Java=101Language= "PHP JAVA"For Lang in $LANGUAGETodoWhat do you want to do with 100, 101 line-by-row output?Done
Workaround-Numeric string:
#!/bin/sh php=100;Java=101Language= "PHP JAVA" for Lang in $LANGUAGE
There are many ways to intercept strings in the shell,
${expression} A total of 9 ways to use.${parameter:-word}${parameter:=word}${parameter:?word}${parameter:+word}4 of the above can be used to replace the default values.${#parameter}The above
Date# Take the day beforedate-d ' 1 days ago ' +%y-%m-%d
Order, E-Name, set function: (alias)Alias Ll= ' Ls-al '
Some special values$$: (for this shell PID)$!: Get the process pid of the subprocess, for example the Nohup command can get the PID$: (
Build a Php+mysql platform, the range for DVWA, set the SQL injection range level of low (easy to test use).Enter 1 in the Submit box, grab the package with Burp, copy the package data to the Cookies.txt document, and drag to the Kali
When you just learned to write shell batches, there is no need to base your logic operations on the basics: arithmetic, here's a simple implementation method in the Linux shell.1. Simple method$ b=$ ((5*5+5-3/2))$ echo $b29In the Linux shell, we can
&& and|| Or# when two files are present[[email protected] ~]# ls 1.txt && ls 2.txt1.txt2.txt# 10.txt file does not exist[[email protected] ~]# ls 10.txt && ls 2.txtLS: Unable to access 10.txt: No file or directory[[email protected] ~]# ls 10.txt | |
Shell script Programming:Classification of programming languages: depending on how they are runCompile-and-run: Source code--compiler (compile)---Program files;Explanation Run: Source code-and run-time start interpreter, run by interpreter side
Bash provides a number of shortcut keys, the following are the most commonly usedCTRL + A cursor moves to the beginningCtrl+e cursor moves to end of lineCtrl+l Clear ScreenCTRL + C terminating processCTRL + Z Hang up processCtrl+u Delete the
4. Bash 's variables4.1 user-defined variables4.1.1 What is a variableA variable is a memory unit of a computer where the stored value can be changed. When a shell script needs to save some information, such as a file name or a number, it is stored
Reference:Http://www.cnblogs.com/tuzkee/p/3755230.htmlhttps://segmentfault.com/q/1010000000156870Http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-scriptAvoid using which, which can be implemented with the following
Today, the company asked me to copy the backup files on the server to the internal server, and as long as they are up-to-date, well, what is the ideal goal of O & M personnel, that is, what can be done by computers, never do it by yourself.System:
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