Text Processing tools:The Three musketeers of text processing on Linux:grep: Text Filter tool (mode: pattern);grep: Basic Regular expression,-e,-fEgrep: Extended Regular expression,-g,-fFgrep: Regular expressions are not supported,-e,-gSed:steam
Guide
At the beginning of learning Inux shell scripting, for its arithmetic and logical operations. It is estimated that many friends feel more difficult to accept. When using the special variable logical operator "[]", you must ensure that
Resolve Bash Shell pin this newspaper error ': not a valid identifierWhen you edit the script in the shell, the runtime appears "': not a valid identifier", or it will appear (: Command not found, many inexplicable symbols) is likely you to edit
Shell ScriptShell script: Always use, but no system to learn, just in the Linux command line mode to knock some simple common instructions, now the system to learn some.First, create a shell script, generally end with. SH (linux suffix is just a
Sometimes we need to look at the network card traffic on the server in real time, here I write a shell script. The script uses a while true "dead loop", every 10s from "/proc/net/dev" to take a value and calculates the average bandwidth within 10s
#printf命令, format the output statement#用于格式化输出, is the echo-enhanced version, a limited variant of the C-Language printf library function, with slightly different syntax#是由POSIX标准所定义, the transplant is better than echo.#printf不会像echo自动换行, so add \ n
Http://man.linuxde.net/testHttp://blog.chinaunix.net/uid-24780853-id-2578709.html[email protected] ~]# man testtest (1) User Commands Test (1) NAME test - Check file types and compare Valuessynopsis Test EXPRESSION t EST [EXPRESSION] []
Contains 3 types of data streams:• Standard input (stdin): code 0, Symbol or >>; standard error Output (STDERR): Code 2, Symbol 2> or 2>>. •>Default iscoverFile contents, if you want toAppendThen use>>Entering or outputting data from a specified
The first part,1. View TCP connection StatusNetstat-nat |awk'{print $6}'|sort|uniq-c|sort-Rnnetstat-N | Awk'/^tcp/{++s[$NF]}; END {for (a in S) print A, S[a]}'netstat-N | Awk'/^tcp/{++state[$NF]}; END {for (key in) print key, "\ T",
This article is part of the "write-A-shell" series, in which we first complete a shell-based implementation of the most basic functionality in the shells. In this article, I will describe the implementation of the idea, as well as the introduction
(i) SEDSed is a streamlined, non-interactive, streaming editor that enters edit commands and specifies file names on the command line, and then looks at the output on the screen.The content of a progressive read file is stored in a temporary buffer
The file descriptor is an integer associated with the file input and output. It is used to track files that have already been opened. The most common file descriptors are stdin, stdout, stderr. We can even redirect the contents of a file description
Brief description:Prompts the user to enter two numbers;Determine whether the input content is a number;Numbers do calculations and feedback results;When the calculation is complete, ask the customer whether to continue using;Provides a way for
Write the play, in the Init 5 level, after running will actively generate two windows, the system and the system on the main services to monitor, and timely refresh, to share.650) this.width=650; "src="
1) How do I pass parameters to a script?./script argumentExample : Show file name script./show.sh File1.txtcat Show.sh#!/bin/bashcat $2) How do I use parameters in a script?First parameter: $ $, second argument: $ AExample: The script will copy the
Usage of Shell exprMathematical operationsLet command expr command BC command $ (()) $[]Http://www.80ops.cn/archives/245.htmlThe expr command is generally used for integer values, but can also be used for strings.The general format is: expr argument
First, string slices:${var:offset:number} takes a substring of a string;Take the rightmost few characters of the character toe: ${var:-length}Note: There must be a white space character after the colon;Second, To take a substring based on a pattern:1
# vi/etc/rc.d/traffic_monitor.sh----------------------------------------------#!/bin/Bashpath=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/Sbin;export PATHfunctionTraffic_monitor {# system version Os_name=$(sed-N'1p'/etc/issue) # Network
Fly2015For FSG shells. No previous contact was the first contact. This time to take the shelling process is still my love to crack the forum to crack the training of the Operation 3 program. For this shell toss for a while, and later was taken care
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