Shell Displays color output

Format: Echo"/033[Word background color; font color m string/033[control code"If you simply display the font color can be fixed control code bit 0m. Format: Echo"/033[Word background color; font Color m string/033[0m"Word Background color range:40-49

Bash Shell read file line and substring

#read Onefile Line by line forLineinch$(Cattest1.txt); Do Echo$line; Done;# whileReadSplitLine by Space whileRead Line Do forWordinch$line Do Echo$word Done; Donetest1.txt#string Splitor substring input=type=ABCDEFGEcho$input, #get

Linux Learning Notes-11th lesson-shell Basics

1. Historical Order (History,↓, ↑,!) )The default value for history is 1000, which is specified in/etc/profilecommand history, which is used to query recent command histories;Use the arrow keys (↑) to query the previous command;Use the arrow keys (↓)

Shell script automatically backs up Linux systems

Today, write an incremental backup system file using shell scripts, and review the shell script related commands, which can be used to back up different files or folders for full backups and incremental backups, depending on your needs. Directly on

How the shell adds content after the specified file location

Recently encountered a problem in the work, want to add a flag bit after the specified location of a file, required to be implemented in the shell script.Problem Description:Want to add a flag after a string of sys_config.fex textFor example, there

Using shell scripts for text splitting

Requirements DescriptionIn bash, we can easily split the text using the split command. Now add two points of demand:1. Insert title at the head of each split file for easy viewing.2. The name of the split file is numbered before the source file name,

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

The Linux shell gets millisecond-level timestamps

There is no millisecond unit of time in a Linux shell, and only seconds and nanoseconds are actually sufficient, since the unit range of nanoseconds is (000000000). 999999999), so the nanosecond is also available from nanoseconds to

Shell Pattern Matching

Special characters in shell pattern matching * Matches any string (including an empty string). ? matches any single character . [...] Matches any character that is contained.

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

To interpret variables through shell scripts

Variable assignment, substitution, etc. #!/bin/bash#1. Assigning values to a single variableVariable1=33 #将变量variable1赋值为33Echo ${variable1} # #第一种显示方法为 ${variable1}echo $variable 1 # #第二种显示方法为 $variable 1variable2= "Hello World"

Test usage of shell scripts

#!/bin/bash#1. Integer comparison operators#整数变量和整数常量比较Num1=15["$num 1"-eq] #测试num1是否等于15echo $? # #退出状态为0, means NUM1 equals 15["$num 1"-eq] #测试num1是否等于20echo $? # #退出状态为1, means num1 is not equal to 20["$num 1"-lt] # #测试num1是否小于15echo $? # #退出状态为1,

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

Linux Learning Note Shell (ii)--Automation script

This article references: Shell Scripting Learning GuideThis article reads as follows: Know the shell directive, but do not know how to complete an automated shell script.Because when editing this article, the author is also a novice. So, in some

Shell-cut usage

The Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' delimited characters '-f fields [[email protected] ~]# cut-c character range Options and Parameters:-D: followed by delimited characters.

Linux system security Settings shell script

#!/bin/sh# desc:setup Linux system security# powered by Www.lvtao.net#account setuppasswd-L XFSPASSWD-L NEWSPASSWD-L NSCDPASSWD-L DBUSPASSWD-L VCSAPASSWD-L GAMESPASSWD-L NOBODYPASSWD-L AVAHIPASSWD-L HALDAEMONPASSWD-L GOPHERPASSWD-L FTPPASSWD-L

Linux series-shell learning notes (Continued 1) process user input,-shell learning notes

Linux series-shell learning notes (Continued 1) process user input,-shell learning notes 1. Run the program with Parameters $0 indicates the program name, $1 indicates the first parameter, $2 indicates the second parameter, and so on until the ninth

Here documentation in Shell,

Here documentation in Shell, We know thatlinuxCommand Line operations can all be placed in the file. After the executable permission is granted, the file can be changed toshellScript. But if we talk to some programsInteraction,shellScripts cannot

Run the system command and write the shell script that writes the output to the specified log file (2 ),

Run the system command and write the shell script that writes the output to the specified log file (2 ), The previous article was a simple script that can be executed and written into logs. However, if it is placed in the production environment, it

Shell exits and returns a summary.

Shell exits and returns a summary. Common Responses in shell: exit, breakm, return Exit: In fact, after each command is executed, an execution state is returned! If the execution is successful, 0 is returned. If the execution limit is not

Total Pages: 541 1 .... 380 381 382 383 384 .... 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.