Ctrl + A cursor moves to the beginning of the lineCtrl + E cursor moves to end of lineCtrl + R Search in the history commandCtrl + L Clear ScreenCtrl + U Clear the cursor to the beginning of the characterCtrl + K Clears the character of the cursor
As mentioned above, the shell is a scripting language, so there must be an interpreter to execute the scripts.The common shell scripting interpreters on Unix/linux include bash, sh, csh, Ksh, and so on, which are used to call them a shell. We often
#!/bin/shFor1 () {For I in 1 2 3 4 5 6Doecho "$i"Done}For1#!/bin/shFor2 () {For i in {1..10}Doecho "$i"Done}For2#!/bin/shFor3 () {Sum=0#int =1For i in {1..100..2}DoLet "Sum+=i"Doneecho "Sum is $sum"}For3#!/bin/shFor4 () {Sum=0For I in $ (SEQ 1 2 100)
Filter GawkGawk is a language that can perform pattern scanning and data processing. Gawk searches for one or more files, finds records (usually rows) that match the pattern, and processes the records by performing the specified actions.
Gawk
The shell is the shell of the operating system, a command interface for users to use the operating system, and a bridge between the user and the operating system kernel.
Shell is commonly known as shell. Refers to the software that provides the
Awk-f ': ' {print $3,$4} ' 1.txtAwk-f ': ' ofs= ': ' {print $3,$4} ' 1.txtawk '/root|user/' 1.txt matches root or userawk '/(OO) +/' 1.txt one or more ooAwk-f ': ' $1~/r*o/{print $} ' 1.txt the first paragraph to match r*o, and only print the third
Learn a bash script today and see that there is a: bin= ' dirname '(dirname filename is the directory where the file is exported, and $ is the file name of the bash file, which is generally used in bash to enter the directory where the script is
The recent obsession with Shell, very interested in it, today is mainly about me a beginner in the execution of shell scripts when the problem encountered:As with all languages, the learning of Linux language starts with Hellworld, so now I have
# Vim/mysh/ipscan.SH #!/bin/bash# Scan the local alive ipaddress# .- the- -if[-F $filename]; Then Echo "The file is exist" forNinch{ -..106}; DoHost=192.168.0. $nPing-C2 $host &>/dev/NULL if[ $? =0]; Then Echo "$host is up"
[Email protected] study]#Cat fileZhang San languageBayiZhang San MathematicsBayiJohn Doe Language theJohn Doe Mathematics -Harry LanguageBayiHarry Mathematics -Harry English -How to implement for the following sort??? Bayi Bayi the -
LL is the alias of Ls-l. You can customize aliases to accommodate certain options in place of certain commands, or you can define aliases to combine multiple commands. For example, define an RM alias RMB to automatically back up to the directory
Writing a script today meets a strange thing.Variable A is definedIf [-a $a];then echo "exists"; else echo "not exists"; fiResult output:ExistsIt's a blind moment, but it's going to change.If [-a "$a"]Of course, a here is a script input parameters,
1. Entering a child shell after using parentheses does not have an impact on the current shell.root#/opt/lxb/dir1# (CD/OPT/LXB/DIR2;PWD)Execution only returns a directory of/OPT/LXB/DIR2, but the current shell is still in Dir1.2, Linux under the TAB
[[email protected] scripts]# cat lvs_start.sh#!/bin/sh#----------------------------- ---------------#Author: created by zhangyiling 2016-06#mail: #Function: this scripts function is lvs start|stop#version:4.1.2#------------------------------------
Demand:1. Enable Python to have the SED replace function in shell.#!/usr/bin/env python#_*_conding:utf-8_*_#the SYS module is used to pass parameters, and OS modules are used to interact with the system.ImportSys,osold_file= Sys.argv[1]new_file= Sys.
#!/bin/bash#declare-a arrayread-p "Please input num[1-39]:" emenum# compare whether the newly generated random number repeats function Comele {for J in ' seq 1 ${ #ARRAY [@]} ';d o if [$1-eq ${array[$J]}]; then return 1 fi-Done return 0}
Enterprise Shell interview questions: Get 51CTO Blog list Reverse sort exam questionsOld boys education and training institutions demand: the need to enter:Please put all the posts in the http://oldboy.blog.51cto.com address according to the
| Copyright Notice: This article for Bo Master original article, without Bo Master permission not reproduced.Hill sort, is a narrowing incremental sort. It is sorted according to the step size, different steps may produce different sequences, but
The hill sort was proposed by D.l.shell in 1959, and the relative direct ranking has been greatly improved. Hill sort is also called narrowing the incremental sortBasic idea:First, the entire sequence of records to be sorted into a number of
Write a bash shell scriptThe script is as follows: it is used to monitor the number of mongo connections and restart the system.#! /Bin/bash# Source/etc/profileConn = '/usr/bin/mongo -- quiet Db. serverStatus (). connectionsExitEOF`Conn1 =$ {conn #*:
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.