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
Although he does not know who Lu Jun is, his book is indeed easy to understand and has the meaning of training materials..
Linux Shell programming started from UNIX and was presented as a human-computer interaction tool in the early days. After
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 +
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"
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
Forwarded from blog: http://www.51testing.com /? Uid-390472-action-viewspace-itemid-232903
TimeCommand is used to print the execution time of a command or program.Time
The time, system time, and time used in the execution of a command in
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
Lesson 6 variables
Part 2 shell programming
7.1 define variables
Format: Name = value # Note: there cannot be spaces on both sides of the equal sign!
This is different from other scripting languages: value can be defined as a variable value without
14th class hour Functions
14.1 create and use functions
Format: Name () {list ;}
An important feature of Shell functions is that they can be used to replace binary executable files or shell built-in commands with the same name.
For example:
CD () {
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