The Shell Three Musketeers grep

Objective How did grep get out?It's going to take us discovering, "g/re/p" see, that's it. "Global Regular expression print" ==> "globally finds the regular expression (RE) and prints the resulting row. ”The grep family consists of commands

Log cut Backup (test) shell script

#!/bin/bashcd= ' df-l |awk ' nr==3 {print $4} ' |awk ' BEGIN {fieldwidths= ' 2 1 "} ' {print '} 'If [$CD-ge 20];thenecho " hard disk space is full and cannot be backed up " | Mutt-s " backup alarm, please replace the hard drive in time " [Email

Reproduced Shell deletes scripts for various annotations

Transferred from: http://www.cppblog.com/zhangyq/archive/2010/10/08/127915.html1.txt content:File contentAabbccAbcdefgHilkdifdfdfMmmmmmmmEeeeeeeeeeeeeeComment Part 2>>>DdeeffSED-E ": Begin; />>/{/>>>/! { $! {N; b begin}; }; s/>>//; };" 1.txtFile

Shell Programming Basics

For C in a B C D E F g;do echo $c; Done sequentially outputFor C in a B C D E F g;do tar czvf install.log. $c. tar.gz Install.log; DoneFor C in {a.. g}; do echo $c; Done the same as aboveSeq 1 10 columns of numbersFor i in {1..10}; do echo $i;

Shell Exercises Explained

Write a script that calculates all the odd and all the even numbers within 100 and displays them separately#! /bin/bashSum1=0For i in ' SEQ 1 2 100 'Dosum1=$[$sum 1+ $i]Doneecho $sum 1Sum2=0For j in ' SEQ 2 2 100 'Dosum2=$[$sum $j]DoneEcho $sum

Three: Shell operators

1:declare commandshell Default is String typeIf subtraction is required, it needs to be defined as an integral typeDECLARE command: Change the default variable type Decalre [+/-] [option] Variable name-set type properties for variables+ Cancel

The shell practice of Linux Learning

The shell practice of Linux Learning 1. Describe the operation principle of shell program (can be attached with necessary graphic instructions);2, summarize all the knowledge points involved in shell programming (such as: variables, grammar,

Shell Common Command Summary

Shell Common Command Summary1 ls command: List filesLs-la list all files and folders in the current directoryLS A * lists all files starting with the A letter in the current directory Ls-l *.txt Lists all files with the suffix txt in the current

Shell Time Statistics Script

#!/bin/Sh#today= ' Date +%y%m%d ' year= ' echo $ '1|cut-c1-4' MONTH= ' echo $ '1|cut-c5-6' Day= ' echo $ '1|cut-c7-8' time= $YEAR-$MONTH-$DAY #echo ' Date-D"$TIME-2 Day"+%y-%m-%d ' URL="/home/work/webdata/logs/focusapi_access_log.$1"#昨天的日期 #yes_dt= '

&& in Shell-linux | |

When the shell executes a command, it returns a return value that is saved in the shell variable $? In When $? = = 0 o'clock, indicating successful execution; = = 1 o'clock, which indicates that the execution failed.    www.2cto.com   Sometimes the

Shell Script Foundation Advanced (i)----shell introduction

Shell Introductionbash programming, then start with the programming, What is the program first? Personal words Explanation: program is the process of processing data. So, The program design consists of : program = data structure +

A simple script that automatically creates shell scripts

Because I usually write some small experimental script, every time to write author,description and so very troublesome, then wrote such a script can create their own small script, code as follows, pure personal original, relatively rough, big God

Shell detailed introduction and programming (ON)

Shell Introduction The shell is a programming language interpreter, which interprets commands entered from the keyboard, and also explains the sequence of commands stored in the script, which is a file containing a series of commands, and

Shell statistics Word Frequency script

  #!/bin/bashif [$#-ne 1];then echo "usage:$0 filename"; Exit-1fifilename=$1egrep-o "\b[[:alpha:]]+\b" $filename | awk ' {count[$0]++}end{printf ("%-14s%s\n", "Word", "Count"), for (Ind in count) {printf ("%-14s%d\n", Ind,count[ind]);}}

Operations Common Shell

List The 10 shells you use mostHistory | awk ' {a[$2]++}end{for (i in a) {print a[i] "i}} ' | Sort-rn | HeadHistory | awk ' {a[$4]++}end{for (i in a) {print a[$i] " " i}} ' | sort-rn | headgrep-v "#". Bash_history |awk ' {++a[$1]}end{for

Linux:shell Common wildcard characters

character meaning * Match 0 or more characters ? Match any one character [list] Match any single character in the list [!list] Matches a character other

September 13, 2015 Course assignments-Questions about the shell

1. Describe the operation principle of shell program (can be attached with necessary graphic instructions);   Span style= " font-size:12px;">shell is a special program that is officially defined as the interface to the kernel and is

Use the shell to count the number of occurrences of a string and sort the display from large to small

Requirement Description: The string in the document is counted and sorted (from large to small), the test.txt content of the first 2 records is displayed as follows: A 12332a 2323a 234234b 232c 23432c 34 statistics and Sorting methods:

Shell Foundation V: Array Preliminary

First, an array overviewArrays: Data StructuresData series, continuous multiple data, can be used to get related elements of the indexDeclaring an array:declare-e arraynameInitialization assignment:arrayname= ("STRING1" "STRING2" ... )Arrayname=

Multi-thread Linux Shell script and linuxshell

Multi-thread Linux Shell script and linuxshell In bash, we run (&) in the background to implement multithreading. for((i=1;i We have added {} & so that the execution in {} can be performed in the background. The above is equivalent to executing

Total Pages: 541 1 .... 474 475 476 477 478 .... 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.