Some common shell commands

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

Knowledge about shell scripts

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.

Bash and dash in Ubuntu Shell

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

Some small shell scripts

JudgeProgramWhether it exists, and start its #! /Bin/sh Echo-e "\ 033 [32 m redmine starting \ 033 [0 m"Redmine-2.1.4/CD/u02/Ruby script/rails server webrick-e production-dVar = $ (PS-Ef | grep Ruby | grep-V grep | WC-l)If [$ var-GT 0]ThenEcho-e "\

Shell script find command

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

Write shell output to a file in Linux

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?

In Windows 7, emacs 24 shell uses gitbash

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

Shell [Command Execution arithmetic extension/parameter processing preliminary usage]

1. Arithmetic Extension #! /Bin/bashx = 0 while ["$ X"-ne 10]; doecho $ xx = $ ($ x + 1) doneexit 0 2. Parameter Extension #! /Bin/bashfor I in 1 2; domkdir $ {I} _ tmpdoneexit 0 3. Processing Parameters #! /Bin/bashunset fooecho $ {FOO:-bar}

Pay attention to spaces when writing shell.

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

FTP folder transmission shell script

######################################## ######################### ######################################## ######################### Ftp_download_file (){ EchoEcho begin: Download $1: $2...Echo Sleep 0 FTP-I-n Open $1User administratorBinMget

Bash command and shell script Summary (3) command

@ 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

Shell programming-Day 2

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:

Shell programming-Day 1

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:

Example of using the while loop in Shell

#! /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

How to judge whether a variable is empty in shell?

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 operation shfileoperation

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

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,

Linux Shell shortcut

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

Linux Shell notes-awk1

One Separator1. Single separator (for example, extract the 11:22:33 string 11 22 33)Echo 11:22:33 | awk 'in in {FS = ":" };{ Print $1 "" $2 "" $3 ;};' 2. Define multiple delimiters (for example, extract string 11 22 33 44 from string 33 & 44)Echo '11

Common Methods for shell to process strings

rfc

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 =

Total Pages: 541 1 .... 420 421 422 423 424 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.