How to open the history command in a shell script.

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

Special usage in bash shell

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

The difference between exit0 exit1 in the shell

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

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 Script Programming Loop statements

ForWhileIfCase 1. for usage 1 for 变量 in 值1 值2 值3..;do 执行语句 done Usage 2for 变量 `命令`;do # 可以引用命令执行结果 执行语句done Usage 3for ((初始值;循环控制;变量变化));do 执行语句done #C语言风格的for循环用法For loop

Explanation of Bash Shell terminal in Linux

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

Shell exercises (15)

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=

Rote memorization in the shell

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

Shell+expect Completing the remote startup service

Expect script: file name: expect_ssh#!/usr/bin/expectset host [lindex $argv 0]set username [lindex $argv 1]set Password [lindex $argv 2]spawn ssh [email prote CTED] $hostexpect {"(yes/no)?" {send "yes\n" expect "*assword:" {send "$password \ n"}}

The second week of Linux learning; shell programming

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 #主要执行命令  

Shell scripts--writing CGI 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

Shell functions use

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:

The use of if,case,for in shell scripts

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

Shell Exercises (12)

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

Sylixos Common shell directives

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

Sylixos Common shell directives

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 shortcut keys

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

The order in which the Bash shell launches the configuration script

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)

One shell per day (eight) Nginx log cutting

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 while & amp; until loop details (Code instance), shellwhile

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,

Total Pages: 541 1 .... 345 346 347 348 349 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.