2015/04/08 Shell Basics-1

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

Shell Tips--color output

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,

The use of shift in the Linux shell

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。

Linux Learning Shell Script

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

9 Shell command grep

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

Installing the LNMP environment with shell scripts

#/bin/bash#----------------------------------------------------------------#data =2015-03-19#auth: Tongcheng#Nginx version:1.6.2#Php: 5.4#Mysql: 5.5.0#-----------------------------------------------------------------#删除关于安装软件的包Delete ()

5 TR of the shell command

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

Init.rc start the shell you wrote

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

bash Shell shortcut keys

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

Shell's basic concepts and variable types

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

Special usage of $0,$?,$! in shell

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

Shell Command Collection

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

Shell Script Example

Shell Basics: http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=452942First, cycle 1-100, and calculate the 1+2+3+4+5+6+7+8+9+10 and#!/bin/bashSum=0For ((i=1;iDoWhile [$i-le 10]Dosum=$ (($sum + $i))BreakDoneDoneEcho $sum#me: Notice the time1.sum=

Linux Shell Basic Learning--cycle and condition judgment

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

Shell cannot execute post-su script

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

Reprint Shell Sort

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

Querying the shell script for IP attribution

#!/bin/bashipp () {exec  '  | awk -F  ' [<>]+ '   ' {print substr ($5,7)} ' echo  $aecho  -e  "\033[44;37;5m  $string 1 \033[0m" done}case $1 in-f) Shiftipp  $1;; -i) shiftstring1= ' curl -s  "http://www.ip138.com/ips138.asp?ip=${1}&action=2"

The face question of the shell

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

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

Total Pages: 541 1 .... 320 321 322 323 324 .... 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.