Redirection of Linux shell code blocks

Code block redirection refers to redirecting standard or standard output to a file within a block of code, or leaving the default state outside of a block of code, in other words, code block redirection refers to the redirection of standard input or

Shell command operations for Linux

1. At the command terminal to get root user rightsIn the terminal, enter:sudo passwd rootEnter new UNIX Password: (enter your password here)Retype new UNIX Password: (Determine the password you entered)Passwd:password updated successfullyLater, if

Collection of shell scripts

#1Sed-I's/Disabled = true/Disabled = false/'/etc/fdfs/storage. conf#2Sed-I's/base_path = \/home \/yuqing \/fastdfs/base_path = \/fdfs \/storage/'/etc/fdfs/storage. conf#3Echo "Enter tracker_ip :"Read tracker_ipEcho "$ tracker_ip"Sed-I

Shell programming (7) --- usage of SED

Sed: A stream editor or a row editor. Sed processing process: sed reads a row from the source file and places it in a temporary buffer zone. This buffer zone is called a mode space and uses the corresponding mode to process the mode space, the

Comments and assignments in Shell

1. Single line comment: # echo "Hello World"2. Multi-line comment:: Tar cvzf $ databak_dir $3 $ date '. SQL' using databak_dir%3%date'.tar.gz '> 2> & 1SCP export databak_dir%3%date'.tar.gz '[email protected] "":/DIR # transfers backup files to

Shell Command Line shortcut

In the shell command terminal, CTRL + N is equivalent to the downward direction key, and CTRL + P is equivalent to the upward direction key.You can use them or the arrow keys in the Command terminal to quickly find historical commands. This is also

Simple shell commands

Part 1 simple common commands 1. Date command   2. Display calendar Cal   3. display the current directory pwd   4. Switch the current working directory By default, the main directory of a Super User is/root, while that of a common user is the same

Shell script Practice Notes (7) -- knowledge about cluster network and Environment Building

Preface: Take notes on network-related knowledge, including IP address A/B/C classification, static address configuration/DNS configuration, and nic information viewing. *) Division of A/B/C/D network addresses IP address = network address + host

Shell programming (1) --- Variables

A variable is a memory space. When a variable is referenced by a variable name, it is called a named memory space. To define a variable, assign a fixed memory space to the variable. assign a value to the variable, that is, fill the data in the

Shell programming (ii) --- shell script description

Script: the source program implemented by the command flow control mechanism based on the actual situation. Script description: 1. Start with shebang, that is #! /Bin/bash. The path of the script interpreter is specified here. 2. Comments starting

Shell programming (4) --- condition judgment based on if

Single branch if statement If condition; then statement1 statement2fi Dual-branch if statement If judgment condition; then statement1 statement2 ...... Else statement3 statement4 ...... Fi Multi-branch if statement If condition 1; then statement1

Shell deletes files other than a specified file

BASH Shell has an extglob option. After the shell is enabled, five pattern matching operators can be identified to facilitate file matching. Method: Run shopt command: shopt-s extglob Close method: shopt-u extglob When this feature is enabled,

Prevents shell from running multiple

I am often very lazy. The main solution to laziness is to use scripts for automatic execution. However, sometimes, for example, processing a piece of data has not been completed, and the next execution starts again, this is a problem. Let's see how

An example of a netizen shell 20140702

After a netizen watched the old boy's shell video today, he asked the following question: 650) This. width = 650; "Title =" snap17.jpg "alt =" wkiol1oz8i_gwllfaaetvavr46c745.jpg "src ="

Shell script test (fan Wai) -- jiebao

Jiebao Jiebao Jiebao Jiebao Jiebao This series of scripts has already opened a forum on GitHub. I name it "Easy shell" (Click here to enter ). At present, you have added the scripts in the previous phases. More scripts will be added to

Several bash shell examples

? Time when the file is read #! /Bin/bash For file in 'ls/root' Do Stat $ File> 1.txt Sed-n "7 P" 1.txt> 2.txt Usetime = awk-F ":" '{print $2}' 2.txt Echo "time =" $ File $ usetime Done ? The while statement that reads each row of a file. Cat afile |

Common shell instances

Tag: Shell 1. Search for all files larger than 500 mb in the current directory, write these file names to a text file, and count the number of files. Find/-size + 500 m-type F | tee/root/file.txt | WC-l or find/-size + 50 m-exec ls

"Notes" "ubuntu" Mint personal shell style script

Alias LL = 'LS-al'Use_color = false# Set colorful PS1 only on colorful terminals.# Dircolors -- print-database uses its own built-in Database# Instead of using/etc/dir_colors. Try to use the external file# First to take advantage of user additions.

Shell Command Line shortcut

In the shell command terminal, Ctrl + n is equivalent to the downward direction key, and Ctrl + p is equivalent to the upward direction key. You can use them or the arrow keys in the Command terminal to quickly find historical commands. This is

Several bash shell examples

Time when the file is read #! /Bin/bash For file in 'ls/root' Do Stat $ file> 1.txt Sed-n "7 p" 1.txt> 2.txt Usetime = awk-F ":" '{print $2}' 2.txt Echo "time =" $ file $ usetime Done The while statement that reads each row of a file. Cat afile |

Total Pages: 541 1 .... 397 398 399 400 401 .... 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.