I. Rights Management1. View file propertiesLs-l2. Permission TypeIi. Linux Users and permissions1. User Management① Viewing usersID User1② adding usersUseradd user1③ Deleting a userUserdel-r user11. User Group① New GroupGroupadd G1② Deleting a
The following scripts are based on the above log format, and if your log format is different, you need to adjust the parameters behind awk. in the analysis log UserAgentCat Access_20130704.log | Awk-f "\" "' {print $ (NF-3)} ' | Sort | uniq-c | Sort-
* * Define local variables, local variables will expire when exiting the shell client * ** * Single quote: Output AS-is * ** * Double quotes: If there are variables, the variables will be output * ** * No quotation marks: Output variable * *You can
1. First create a directoryVI hello.sh2. Write the first line of the shell#!/bin/bash (in order to declare a shell script, the first line must be written like this)3. You can add comments #the First program (this line of add # is not in effect)4.
Write a script to find the/data/log directory, the last created time is 3 days ago, the suffix is *.log file, packaged and sent to 192.168.1.2 Service under/data/log, and delete the original. log file, leaving only the packaged
1 "Judge input as number, character or otherScript code:Test results:2 "Averaging:Test results:3 "self-reducing output:Script code: Test results:4. Add a prefix to the file:Script code:Effect Display:5 "Batch test file is present:Script
Writing ScriptsVI delbak.shThe code is as follows :#!/bin/shlocation= "/home/mysql/backup/"Find $location-mtime +7-type f |xargs rm-fexplanation :Location is the directory where the lookup is set--mtime +7 is set to 7 days ago (delete files from
Use the conditional function if to compose a shell function called F_judge, which implements the following functions1) when the/home/log directory exists, move the files or directories that start with all TMP in the/home directory to the/home/log
Pipe character and job control; indicates that the previous command executes the next command in sequence[email protected] ~]# cat 1.txt |wc-l; Cat 1.txt |grep ' aaa '2AAAAAAAAAAAaqweaaaaaaaaa&&: The previous command is correct to execute the
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7E/AC/wKiom1cGe1ui4oqIAABm6P93Pb8114.jpg "height=" 142 " Width= "192" alt= "Wkiom1cge1ui4oqiaabm6p93pb8114.jpg"/>
Shell script to today, I can only kept
Delete"Ctrl" + "D" removes the character at the cursor location equivalent to VIM x or DL"Ctrl" + "H" removes the character in front of the cursor, which corresponds to the HX or DH in vim."Ctrl" + "K" removes all characters after the cursor
Learning from the previous articles, we learned the basic syntax of the shell. In the actual operation of Linux, we often see the command will have many parameters, such as: Ls-al, and so on, then how this parameter is handled? Let's take a look at
Shell Common ScriptsAuthor:headsen Chen 2017-10-17 15:36:17Personal original, reproduced please indicate, otherwise, legal liability shall be investigated1,vim name.grep.sh2,cat tellme.sh3,cat idcheck.sh4,cat case.shNote: The file name is called in
To test the shell's looping nesting syntax1[Email protected] test]#VIXunhuanqiantao.SH 2#!/bin/Bash3 #程序功能描述:4 # test Loop nesting5 #作者: Lone boat Point6#版本:1.07#创建时间: .-Ten- A Geneva: $:
(title): Determine if the incoming parameter is IPIdea: 192.168.1.1is the condition of the IP, * * * dot decimal This four number must be less than 255Dot decimal must be guaranteed to be a number, not a letter#!/bin/bash[ -z $1 ] && echo "uesage :
Linux often need to delete user actions, manual operation to perform Userdel operation can, if the deletion fails according to the error prompt action. But what if the script needs to invoke the Delete user action? Use the following example to
Steps to create a shell program:First step: Create a script file. Sh.Second step: Grant permissions so that it can execute chmod u+x. shStep three: Execute./example or SH exampleShell structure:1. #! Specifies the shell that executes the script2.
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.