string: AA bb cc DD
Requirements: The word in the output string
Pattern 1:
*@*:~$ echo AA bb cc DD |GREP//b//w*//b
RESULT:AA BB cc DD
Pattern 2: Substituting the + number for *
*@*:~$ echo AA bb cc DD |GREP//b//w+//b
Result: No output
Here document is one of the ways in which you define block variables in bash.
The form of the definition is:
Command
...
...
...
HereIts role can be used to define a variable, the command and the content between here using the way to input to the
command Substitution
In Bash, $ () and ' (inverted quotes) are used for command substitution.The command substitution is similar to the variable substitution, which is used to reorganize the command line, complete the command line in the quotation
Sed and awk are powerful text filtering tools in the UNIX environment.
With SED and awk, it is easy to edit local files, and it is easier to use regular expressions to filter out the output of other commands.
SED represents the stream Editor,
To get all file names in the directory (including subdirectories), the path and file size should be the easiest to use with the shellShell script: lsdir.sh
#!/bin/bash
function ergodic () {for
file in ' ls ' do
if [-D $ '/' $file]
then
A shell program that replaces a section of a line near a keyword in a text file:
#!/bin/bash file=$1 findpattern=$2 linegap=$3 replacepattern=$4 substitue=$5 Help () {echo Help:echo \$1:file\ ' s full Path \ (include filename\) echo \$2:the key
Requirements:No. 0 Step: Write the simplest shell command interpreter, this program is taken from Apue example 1-5, command can not take parameters.What the trainees need to do is as follows:The command interpreter is first a dead loop.Prints a
Note: The example of this article comes from the collection and collation of the network, with my comments attached. Common uses of ①i/o redirection
Symbolic meaning
cmd1 | cmd2 pipe character, the standard output of CMD1 as the
Recently learning a Linux script, here is the meaning of $, $, $!, etc. in shell scripts
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
HBase is a distributed, column-oriented, open-source database derived from a Google paper, BigTable: A distributed storage system of structured data. HBase is an open source implementation of Google BigTable, which leverages Hadoop HDFs as its file
Introduction Enterprise Shell interview question: Master please detour! Enterprise Practical Problems 6 : developing shell scripts to solve DOS secure Linux server production casesaccording toWeblog or the number of network connections, monitor when
The problem of direct violence to solve the words of time complexity is certainly not, so, we want to calculate the contribution of each value, for each number of the minimum worth how many times, when the maximum worth how many times, and finally
Functions in the shellThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly.Format: function F_name () {Command}The function has to be on the
I suddenly wanted to monitor the network card Traffic in Linux and didn't want to use cacti. I thought it was very troublesome to Configure SNMP. Ready-made tools seem to be useless. Decide to write a script by yourself.
Click (Here) Fold or open
Netsh (Network shell)
Configure network interfaces, Windows Firewall, routing & remote access.
SyntaxNetsh [Context] [Sub-context] command
KeyThe contexts and commands available vary by platform, the list below is for Windows 2008.Use interactive
Table 4-3 lists the commands supported by the EFI Shell Interface on the unit-based HP integrity server.
When npartition is active but the operating system has not been booted, you can access the EFI shell from the npartition console.
You can use
Shell basics 2: Search Skills, use of find and xargs
Execute shell commands using exec or OK When using find, you only need to write the desired operation in a file, you can use exec to search with find, which
Variable:
Local variable: valid only for the current
Environment variable: valid for both the current shell and sub-shell
Export A = 3 define a as a variable and assign 3 to
A = 3
Export a reference does not need to be added &
Export also views
1. Install busybox
Busybox is a single executable implementation of standard Linux tools. Busybox contains some simple tools, such as CAT and ECHO, and some larger and more complex tools, such as grep, find, mount, and telnet. Some people refer to
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