1.linux Bash built-in commands differ from common commands: which can't find them. Bash built-in commands2.history is a bash built-in command that can be opened by bash3.set-o See if Open1) in Interactive view[Email protected] ~]# Set-o |grep
1 ${bash_source-$0}Represents the full path of the currently executing script.2 cd-p enters with physical path/usr/localhadoop now chains to the/home/houzhizhen/usr/local/Hadoop/hadoop-2.72
Exit (0): Run the program normally and exit the program;Exit (1): Abnormal operation results in exiting the program;Exit 0 can tell the user of your program: Your program is finished properly. If exit is not a value of 0, then the user of your
Shell script advanced One, Shell script advanced condition test
When you write a shell script, you often need to judge some conditions, and you can use Test command test to help complete the test process. The test command tests whether a
Shell: is an outer layer of the kernel Protection tool, and is responsible for the completion of user-to-kernel interaction;Provides an interface for users to interact with the kernel, which receives commands entered by the user and sends it to the
Exercise 1:Monitor network cardrequirements: every 10 minutes to detect the specified network card traffic, if the network card traffic is 0, restart the network card! (Use cron Task Scheduler!) )Reference Answer:#!/bin/bash# date:2018 March 21 lang=
One, the shell quotes1. "", double quotation marks (do not retain the full content, such as encountered $, anti-quotes, \ etc will execute the corresponding shell)echo "Today is `date`" -> Today is Wed Aug 2. Single quotation mark (full retention
Pstree-p #显示进程编号 (tree) echo $$ basic structure of #显示当前shell进程编号 scripts: #! Shebang (indicates what shell is used to open a file, typically using bash) configuration_variables #定义变量FUNCTION_DEFINITIONS # define function Main_code #主要执行命令
Recommend the initial CGI, after reading the approximate, probably to the CGI has a general impression. Here's how to write code in a CGI script that implements a mix of shell and HTML tags:#!/bin/bash#index.cgiecho
function definition Format:It's a bit like JS, but the function keyword is optional in the shell.Such as:sum{ //Shell statement} function sum () { //Shell statement}Function Call Method:Sum parameter 1 parameter 2 ... Get function Parameters:
DirectoryI. Condition selection: If statementTwo. Conditional judgment: Case statementThree. For loopI. Condition selection: If statement
Single Branchif judgment condition; thenBranch code with true conditionFiExample: Judging whether a number
Exercise 1:Detect file ChangesRequirements: There are two Linux servers A and B, if a can ssh directly to B, do not enter the password. A and B have a directory called/data/web/. Here are a lot of files, of course, we do not know the specific number
1. Shell command IntroductionThe shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the instruction entered by the user and sends it to the kernel for execution. A shell user
1. Shell command IntroductionThe shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the instruction entered by the user and sends it to the kernel for execution. A shell user
Shell--Unix--Bourne shellBash--linux--Bourne againShellCommand parser function:0 go to specify a path to search for user-entered commands0 environment variable--Path1. command or directory completionShortcut key: Tab1.2. Traverse History
1. The way bash checks the environment variable file depends on how the system runs the shell, typically there are 3 ways the system runs the shell:1 shell that runs by default after the system user logs on 2 ) Non-login interactive run shell 3)
Nginx log will increase with the amount of traffic, the larger log will affect the analysis log when the analysis and processing, we can use the shell to the Nginx log timing segmentation, to weeks or days, for a long time log can be deleted
Shell programming-detailed explanation of the while & until loop (Code instance), shellwhile
Loop statement commands are often used to execute a command or a group of commands, so they are stopped when the conditions are not met. In shell scripts,
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.