1. Use a command to find the files that have been modified in the last 24 hours in the/etc/directory, and the suffix name isthe. log file and delete it.Find/etc-type f-mtime-1-name "log* "-exec rm-rf {} \;2. From the Test.log file, find the row
One: Shell introductionThe shell is a command interpreter that provides interaction between the user and the machine, supports specific syntax, and each user can have his or her own specific shell,centos default of bash, and Zsh,ksh.Two: Command
8th Shell Programming Character Menu ManagementI. Shell function definitionFunction menu () {Echo ' This is a func!! ';}Two. Shell functions useMenuThree. How to use the Cat command HeredocCat
When operating on SECURECRT, do the following carelessly:?????????????????? [[email protected] ~]# echo "Alias rm= ' echo this command does '" ">. Bash_profile?????????????????? [[Email protected] ~] #source. bash_profile?????????????? When the
1. ExercisesFor a file, 1 to 5 lines delete the line with English, 6 to 10 lines delete the English characters inside;2. AnalysisThis requirement, with the SED command can be solved, mainly used to match the knowledge of replacement.3. Scripts#!/bin/
1. (1) Change the main prompt to the user's home directory name (hint: reference material 4.6.8 section environment variable PS1 and HOME usage)(2) Assign the string DOS file c:>\ $student \* to the variable x and display it (hint: note the choice
File header#!/bin/shBasic syntax:Define variables:Your_name= "Aivy"In addition to explicitly assigning values directly, you can also assign a value to a variable using a statement: for file in ' ls/etc ' or for file in $ (LS/ETC)The above statement
The For loop syntax is structured as follows [[email protected] tmp]# cat 1 . sh # !/bin/bash for i in ' Seq 3 " do echo $i done [[email protected] tmp]# sh 1 . sh 1 2 3 Bulk Modify file name [email protected] tmp]# ll
I. OverviewYou can pass parameters to the script when you execute the Shell script, and the format of the parameters obtained in the script is:$n. n represents a number, 1 is the first argument to execute the script, 2 is the second argument to
Analyzing Nginx Access Logsawk ' {a[b[$1]++]}end{for (I=length (a); i>0;i--) for (j in B) if (b[j]==i) {c++;if (c ' Www.dwhd.org_nginx.logThe effect is as followsSort statistics in reverse orderCat Access.log| Sort| Uniq -c| Sort 1 -n-rUniq only the
Shell Command Application Exercise(1) The use of the following documents is briefly reviewed through the Help information①/ETC/PASSWD (Hint: View this file description description via man 5 passwd)②/etc/shadow (Hint: View this file description
| The operator pipe symbol is a very powerful feature of UNIX, and the symbol is a vertical bar: "|".Usage: Command 1 | Command 2 His function is to pass the result of the first command 1 execution as input of the Command2 to command
/ETC/PASSWD Purpose: This directory stores the operating system user information, which is visible to all users. Consists of 6 semicolons consisting of 7 information, user name, password (encrypted), UID (user ID), GID Group ID, user's full name or
8.6 Pipe symbol and job controlPipe break: The data from the previous command to be output to the screen as the standard input of the latter commandJob Control: When you run a process, you can use CTRL + Z to pause it, then the FG (foreground)
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