[Shell] Linux calculates the number of times a string "sent IP" appears in a file.

I tested the product performance a few days ago and ran for several days.Program, Stopped today, because the program is not very stable, the test is complete, it is required to count how many times the program started. So I opened the log file and

Current Shell & subshell & separate invocations

1. "Current Shell"Commands enclosed in {} are executed in the current shell. there must be whitespace after the opening {, or else you get a syntax error. one more restriction: commands within the {}'s must be terminated with a semicolon when given

Collect notes about Linux Shell

1 history The history command lists used commands. the user's history command is stored in the. bash_history file in the user's home directory. 491 sync 492 logout 493 go-m3 494 logout 495 go-m3 496 go_m3 497 ll 498 ll bin/499 go-m3 Run the 495

Summary of scattered shell usage

Shell is widely used during this period of employment. There are some scattered points, which should be noted here. If The IF usage in Shell differs greatly from that in C. It is generally used in combination with [] (currently I only used this

Simple shell command redirection

It took me a bit to write this evening. It started with argv, which is a two-digit array.ProgramIt is always not displayed. later it was found that execvp only supports pointer array =. = Okay ....Program idea: After the sub-process is enabled,

Add a custom shell in Linux as a service automatically run by the System

Recently, I encountered a problem. After the database is installed, the set oratab is not easy to use and cannot be started automatically. solution:   Log on and edit with Root /Etc/rc. d/rc. Local file. This file is executed after the system

Basename, dirname Shell

Basename is the name left after the directory is removed.Example: shell> temp =/home/temp/1. TestShell> base = 'basename $ temp '(reverse quotation marks)Shell> echo $ BaseResult: 1. TestDirname is the DirectoryExample: shell> temp =/home/temp/1.

Printf and shell touch

Formatting: printf'print format' actual contentWhat are the characters represented by the value 45?Printf'/x45/N' Note:/xnn is a two-digit number, which can be converted into characters. Introduction to SED and awk tools:You can analyze the

Shell getopt usage

Obtain UNIX options: one advantage of UNIX is that standard Unix commands have the same command line format during execution: Command-options parameters. If the shell program is executed in the preceding format, the Bourne shell provides a statement

Shell loop, judgment introduction, and instance

There are three main types of shell loops: For, while, and. There are two main types of shell Branch judgment: If and case. 1. For Loop #! /Bin/bashfor file in $ (LS/tmp/test/mytest | grep SH) // For in is the basic format of Shell, the for in root

Unix shell and if Parameters

Source Address: http://space.itpub.net/10687260/viewspace-293440 [-A file] true if the file exists.W (g3cu. T * mb7q6a0[-B file] If the file exists and is a special block file, it is true.S8ydayx 'gi0[-C file] If the file exists and is a special

Linux Shell Learning

1. Man Shows color characters In ~ /. Add the following content to bashrc: Export less_termcap_mb = $ '/E [01; 31m'Export less_termcap_md = $ '/E [01; 31m'Export less_termcap_me = $ '/E [0m'Export less_termcap_se = $ '/E [0m'Export less_termcap_so =

Basic shell programming

I used shell to write it. At that time, I had a little understanding of it. Now I completely forgot it. But I still can understand it, so I won't write it. They are all simple questions assigned by teachers.   1. Select addition, subtraction,

Unix shell programming (2)

Unix shell programming (2)   Character matchingThe asterisk (*) matches more than 0 characters, and the question mark (?) Match 1 character.For example:Ls [A-Z] * [0-9]Displays the list of objects whose names start with lowercase letters and end

Unix shell programming (6)

Unix shell programming (6)   VariableUnix shell allows the value to be included in the variable.To store a value into a variable, you only need to write the variable name, followed by an equal sign, followed by the variable value.Variable = ValueDo

Shell string Truncation

Removes the leftmost character from the string. [admin@v035114 ~]$ vi test.sh 1 STR="abcd" 2 STR=${STR#"a"} 3 echo $STR 4 STR=${STR%"d"} 5 echo

Java calls shell commands and obtains execution results

The process and runtime classes are used. The returned values are obtained using the getinputstream () method of the Process class. package ark;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import

Linux Shell counts the number and replacement of words

1. count the number of occurrences : % S/178 // ng Text Test 711[10.235.170.22:8123] 0 10.232.20.178 1648042 1648042 0 2013-07-29 20:01:35711[10.235.170.22:8123] 11 10.232.20.178 6445135

Shell if command parameter description

-B. returns true if the file exists and is a block file.-C: returns true if the file exists and is a character file.-D. If pathname exists and is a directory, true is returned.-E: returns true if the file or directory specified by pathname exists.-F

Shell variable assignment and replacement

1 #! /Bin/bash 2 3 # variable assignment and replacement 4 5 A = 375 6 Hello = $ A 7 8 # --------------------------------------------------------------------- 9 # note that when assigning values, do not have spaces before and after the equal sign. 10

Total Pages: 541 1 .... 494 495 496 497 498 .... 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.