Shell command-line operations

1.1 Shell prompt[Email protected] ~]$If the last character is "#", it indicates that the current Terminal session has Superuser privileges. This permission can be obtained by logging in with the root user or using a terminal that provides superuser

Summary of mathematical calculation in shell

1. Examples of error methodsAVar=1+1Echo $varThe result of the output is the same, tragedy, hehebVar=1var= $var +1Echo $varOutput is the same, still tragic, hehe2. Correct method1) Use LetVar=1Let "Var+=1"Echo $varThe output is 2, no tragedy this

Linux shell crontab (timed task) detailed

1. Definition:The crontab command is commonly used in Unix-and Unix-like operating systems to set instructions that are executed periodically. The command reads the instruction from the standard input device and stores it in a "crontab" file for

Shell script declare declaring variables

Linux bash Shell's declare declare or typeset built-in commands (which are exactly the same) can be used to constrain the properties of a variable. This is a way to use a less restrictive definition type in some programming languages. Command

The regular expression of the shell script learning note

Basic Regular expression (supports shell tools such as Grep,sed,awk)* 0 or more of the ordinary characters in front of the * character. Match any character^ matches the beginning of the line, or the following character is non$ Match Line End[] Match

Application of getopts in shell

The format of the statement is: Getopts The general format is:Getopts option_string VariableWhere option_string contains a valid single-character option. If the getopts command finds a hyphen on the command line, it is compared with the word

Shell Tips--use "$$" and "$" to prevent the same script from starting multiple times

When you write a shell script that starts with the Crontab timer task, if the shell script execution time exceeds, Crontab pulls the script time interval, this time may appear the same script simultaneously initiates several times the phenomenon.

Shell Learning 21-shell function

function allows us to divide a complex function into several modules, which makes the program structure clearer and the code reuse more efficient. Like other programming languages, the Shell supports functions as well. The Shell function must be

Crontab let Linux execute shell scripts at timed intervals

Use crontab you can perform a specified time in the Shell script or a series of Linux command. For example, the system administrator schedules a backup task to run every dayEntry# crontab–eThis enables the edit mode to open the personal crontab

Mac Server service updates several common shell commands

The MAC server needs to turn on Telnet first. Open with: System Preferences, share check remote loginCommon commands are:Copy (copy the native file to the remote server) Scp-r Local path/file userName@192. 168. XXX. XX:/tmp#userName为远程服务器用户名称,

Shell command Line Quick Edit command

CTRL r: Command line appears reverse-i-search, input character will match command in input historyCTRL P: Go ahead and look through historyCtrl N: Looking back over historyCtrl A: Command headerCtrl e: Command line endCtrl F: Jump forward one

Shell numerical calculation, fractional calculation

In a shell script, you can perform numerical calculations,如加减乘除,通过expr、let、(())等完成,文章介绍:http://blog.csdn.net/longshenlmj/article/details/14166193但是上面的运算只支持整数。小数计算怎么办?Shell small number calculationComplete with Bc,awk and Nawk tools, etc.The code for

Problem solving in shell that only loops the first row when using while loop ssh

Recently writing a shell script, I would like to use a For loop to read the contents of the file, but found that every line in the file has a space, obviously with a for loop does not work, my intention is to read a row of the file content, so

SSH login of common shell in work do not enter "yes"

ip= "192.168.5.166"SSH $ip-o stricthostkeychecking=no//SSH login do not enter "Yes"Port= "26092"Pid= ' Netstat-anlp|grep $port |awk ' {print $7} ' |awk-f '/' ' {print '} 'Pname= ' ps-ef|grep $pid |grep-v grep|awk ' {print $NF} 'Dir= '

Script receive options for shell scripts

1. Create a script that can add script information to other scripts:#vim cs.sh#!/bin/bashCat > $ #!/bin/bash#Name: ' BaseName $ '#Description:#Author: TEST#Version: 0.0.1#Datatime: ' Date ' +%f +%t "'#Usage: ' BaseName $ 'EofVim +8 $2. Modify the

Shell getopt Get Parameters

#!/bin/sh# description show_usage= "args: [-I,-P,-u,-w,-A,-s,-D,-v] [--ip=,--port=,--user=,--pwd=,--path=,--scrip t=,--debug=,--version=] "#参数opt_ip =" "opt_port=" "opt_user=" "opt_pwd=" "opt_path=" "opt_script=" "opt_debug=" "Opt_ version= ""

NPM should be run outside of the node repl, in your normal shell

Node version: v0.12.4When installing NPM install-g-supervisor is present:NPM err! AddLocal Could not install D:\Program Files\nodejsNPM err! Windows_NT 6.3.9600NPM err! argv "D:\\Program files\\nodejs\\\\node.exe" "D:\\Program files\\\\node_modules\\

Shell Script (iii)

Shell Script (iii)2. File sorting, merging and segmentation(1) Sort command#-c: The test file is sorted;-K: Specifies the sort field;-M: merges two sorted files;#-n: Sort by number size;-o: Writes output to file;-r: Reverses sorting results#-t:

Questions about the logon shell cannot successfully enter the user name password

Recently found in the group feedback, login layer can not successfully enter the user name password situation, roughly looked at, a little summary:I encountered the login can not successfully enter the user name password situation there are two, one

Shell programming notes, shell programming

Shell programming notes, shell programming1. Bash variableUser-Defined variables # local variablesEnvironment Variable # global variableLocation Parameter VariablePredefined VariablesX = val # value assignment$ X # CallThe default value of the

Total Pages: 541 1 .... 152 153 154 155 156 .... 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.