PS: Red font is an important part, look carefullyFirst, Shell features1. History view the command record, default records 1000;[Email protected] ~]# history 1 vim/etc/hosts 2 Ifconfig 3 cd/etc/sysconfig/network-scripts/ifcfg-4
The shell, as a scripting language, is a skill that every Linux administrator must master, sometimes adding some background color to the output in the shell, making the script a little more aesthetically pleasing, and using echo to output a string,
Position parameters can be usedshiftcommand to move left. Like whatshift 3Indicates that the original$4Now become$1, the original$5Now become$2Wait, the original.$1、$2、$3Discarded$0Do not move. With no parameters.shiftcommand is equivalent toshift 1。
First, write a script, let the user input: 1.first name 2.last name, last displayed on the screen: Your full name is: Content#!/bin/bashread-p "Please input your firstname:" firstnameread-p "Please input your lastname:" LASTNAMEECHO-E "your ful L
When we need to find a specified file in thousands of files, we may be able to use LS filename. The results will list some information about this file. But this is not the best way. Or specify the rules of the file, LS obviously can not meet our
This is a magical command.TR's whole spell is translate, that is, translation. The interesting thing is that we can make rules for translation. Use the following:TR [option] set1 [Set2]TR accepts input from the standard input and prints the result
What to add========================= Gorgeous split-line ====================+ Start haha_test@@ -1397,3 +1399,8 @@ Service poad/system/bin/poad User System Group system oneshot++ #add For Haha_test+service
TRL key combinationCTRL + A: The cursor moves to the beginning of the line.CTRL+B: The cursor moves left one letterCTRL + C: kills the current process.Ctrl+d: Exits the current Shell.Ctrl+e: The cursor moves to the end of the line.Ctrl+h: Deletes
Static languages: Compiled languages are converted into executable formats in advanceStrongly typed (variable)Key words:C C + + JAVA C #Dynamic language: Interpreted language on the flyWeak typeEdge Interpretation Side ExecutionASP. NET Shell PHP
Variable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the
CCat Zdd Browse the contents of a ZDD fileCat Zdd1 Zdd2 Browsing the contents of multiple filesCat-n ZDD Browse the contents of a file Zdd and display line numbersCD back to the start directory, that is, just logged into the system directory, CD
For loop1. Note Do must wrapFor i in {1..10} do echo $idone2. Note Do must wrapFor I in 1 2 3 4 5 do echo $idone3. Traverse the results of the command outputFor shname in ' ls *.sh ' do echo $shnamedone4. For loops similar to high-level languagesFor
Issue: After executing the "su– username" in the shell script, the script terminates execution and switches to the interactive interface behavior of the specified user name in su: I execute a script in root, but some of these commands or scripts
Http://blog.sina.com.cn/s/blog_6d09b5750100x6zg.htmlThe first is the shell sort implementation of multi-column sorting, here to add a vertical line to split, the following file
on the Internet to see a test shell problem--the statistics of a folder size greater than 7MB the folder Okay, I'll do it. Deep, personal feel, this problem is the main test of the regular use of the Linux proficiency (I am not very familiar with,
Linux shell string truncation and splicing, linuxshell
Linux string truncation is very useful. There are eight methods.
Assume there are variablesVar = http://www.hao.com/123.htm
1 # intercept, delete the characters on the left, and retain the
Shell Escape Character collation
Escape: place the backslash (\) before the character to be escaped, indicating that the character should be considered as a common character.
When sed awk is used, escape characters are occasionally used.
For
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.