It is for entertainment only and is not responsible for the result of misoperations.
1. Remote copyRoot@192.168.1.38:/f/u/C/k.txt.Root@192.168.1.38 SCP-r-p1234:/beauty.
2. Force Overwrite\ CP-r/data/data1
3. synchronous copy of
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.
By default, the Ubuntu shell is installed with Dash instead of bash.Run the following command to view the sh details and confirm the corresponding ShellProgramWhich is:$ LS-Al/bin/sh
Dash is lighter and faster than bash. Bash is more commonly
The find command is used for searching. It has powerful functions in the following format:
Find pathname-options [-print-Exec-OK...]
Pathname: directory path searched by the find command. For example, use "." To represent the current
As you know, you can use shell to output information to the screen. However, if the output content is too large and redundant, it is not easy for us to analyze and extract the screen information we want, so how can I write shell output into a file?
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
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
@ Rigorous use of set @
Set-eux
-E. If the command returns a non-zero value, exit immediately.
-U when the execution parameter is included, the unset variable is used as the error handling (if the extension attempt appears in the unset variable, the
Ls-l dir1 | WC-L.
1. While condition; do done // () [] Test2. Until is the same as above. It is executed only when the condition is not true.3. /Dev/null: Unix black hole. Used to clear the file CAT/dev/null> XX find-name a.txt 2>/dev/null4. Note:
Is there the same command as NBTSTAT in Linux! View other information through IP: Host Name, Mac, etc.
You can use nmblookup-a ip address.
You can also use nbtscan.
ARP command: ARP iPad. Local or ARP 192.168.1.108 or ARP-A or ARP
VI search string:
#! /Bin/sh
# Filename: 2.sh
B = 9
E = 15
Tmpb = $ B
While [$ tmpb-Le $ E]
Do
Echo $ tmpb
# Tmpb = 'expr $ tmpb + 1' // OK
Tmpb = $ (expr $ tmpb + 1)
Done
After the script is executed, the output result is:
9101112131415
Note: The
To determine whether the variables in a script are empty, I wrote a shell script like this:
#! /Bin/sh
# Filename: Test. Sh
Para1 =
If [! -N $ para1]; then
Echo "is null"
Else
Echo "not null"
Fi
Then run the Script: test. sh uses
Shell file operation functionsShfileoperationFunction:1. Copy one or more files2. delete one or more3. Rename the file4. Move one or more files
The same WIN32API function is:Copyfile (), deletefile (), movefile ()Movefile can be renamed!Win32 API
Special characters in Linux Shell
1. braces:
Usage 1: wildcard Extension
Eg: ls my _ {finger, toe} s
This command is equivalent to a combination of the following commands:
Ls my_fingers my_toes
For example: mkdir {usera, userb, userc}-{home, bin,
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
Reprint: http://www.51testing.com /? Uid-225738-action-viewspace-itemid-218002
ShellProcessing
StringMethod (for future reference)
1. Construct a string
Direct Construction
Str_zero = Hello
Str_first = "I Am a string"
Str_second =
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.