1. Exec Read lineRushid = $ lineExec is a pipeline command, which is generally not used separately.Read from the CSV file and assign each line to lineRead is used to accept keyboard input in shell.
Line is a variable that accepts output parameters.
When using shell in Linux, arrays are occasionally used for convenience. The declaration method of the array is:
Array = (element1 element2 element3... elementn)
That is, wrap the array elements directly with parentheses, and separate the array
Today, we found that gitbash can be directly opened in shell. gitbash provides some useful Linux-style commands. The most important thing is that you do not need to open another gitbash terminal to manipulate git when using Emacs.
In ~ The
Struct point {int X, Y; point () {} Point (int xx, int YY) {x = xx; y = YY;} point operator-(point const & B) const {return point (x-b.x, y-b.y);} int friend operator * (point a, point B) {return f_abs (. x * B. y-a.y * B. x) ;}int len2 () {return x
Option-Y: The operation is performed without user confirmation.
Yum-y install : Install the specified software.
Yum-y update: Upgrade the software.
Yum-y update : update a specific file
Yum check-Update: checks whether software needs
Below is a simple Linux ShellCodeThe function is used to find the current directory and all its directories which contain the four characters "html" and print the file name, at first glance, there should be no problem with this code, but there are
CTRLKey bound_____________CTRL +-Jump to the start of the lineCTRL + B-Move back a charCTRL + c-Terminate the commandCTRL + d-Delete from under the cursorCTRL + E-Jump to the end of the lineCTRL + F-Move forward a charCTRL + k-Delete to EOLCTRL +
Iv. Loop Structure statements
Common shell loop statements include for loop, while loop, and until loop.
ForLoop
Syntax: for variable in list
Do
Operation
Done
Note: The variable is used inside the loop to refer to the object in the List currently
List of Common Unix shell commands
Passwd Change User Password PWD print current directory CD change Directory ls list directory file wildcards *,? Any number of characters and a single character file print out the file type cat display
What is shell? Shell is an interface for user interaction with the kernel. It can be used as a command interpreter. After a user inputs a command, shell will explain it and then send it to the kernel for execution,
After knowing what shell is, let
Use Find and SED
# First query the number (sed-N)
Find.-Name '*. htm' | xargs sed-n'/old/P'
# Replace (sed-I)
Find.-Name '*. htm' | xargs sed-I's/old/new/G'
Use grep and SED
Grep-l old *. htm | xargs sed-n "/old/P"Sed-n'/old/P' grep-l old *.
1. query the row number of the string.
Grep-n "XXX" str.txt #-N print the prefix of the number of lines where the character "XXX" is located in the file "stringstr.txt"
Example:
Str.txt
XxxYyyZzzXxx
Enter the SEARCH Command: grep-n "XXX"
$0 script execution name
$ N the nth parameter value of the script, n = 1 .. 9
$ * All parameters of the script
$ @ All the parameters of the script (which have similarities and differences with $)
$ # Script parameter count
$ PID for Script
Summary of Linux Shell shortcut operations (including shortcut keys and efficient operations ):
CTRL +: Start with the command line
CTRL + E: End of the command line
CTRL + L: Clear screen, equivalent to the clear command
CTRL + u: Cut the content
Chapter 4 directory operations
4.3.1 column directory
$ Ls directory
-D option, force to display only the directory name, not the content
4.4 operation directory
4.4.1 create a directory
Mkdir directory
Example: $ mkdir hw1
Create the hw1
Monitor wwwa.applevb.com by using undisclosed Functions
In Windows, there is an undisclosed function shchangenotifyregister. You can add it to the system message monitoring chain in your window. This function is available in Delphi.Is defined as
By learning how to program using the bash scripting language, you can make the daily interaction of Linux more interesting and productive. You can also use the familiar and favorite standard UNIX concepts (such as pipelines and redirection ). In
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