Real-time server network speed monitoring (shell script)

Usage: #> Moniotr. Sh eth0 1 #! /Bin/bash # Test network width# The first parameter indicates the Real-Time refresh time after the NIC name. 1 indicates 1 second. Function usage{Echo "Usage: $0"Echo "e.g. $0 eth0 2"Exit 65}If [$ #-lt 2]

Count the number of lines of code in a shell

Xcode statisticsCodeIt is very simple to use shell commands. Open the terminal, enter your project directory, and execute the following code Find.-Name "*. m"-or-name "*. H"-or-name "*. html"-or-name"*. C" | xargs WC-l To collect statistics on

In the shell script, the SED command fails to be parsed.

''Causes sed Command Parsing to fail. The experiment is as follows: Try to replace a single backslash with two backlash, that is\ Replace \\ $ Cat t1.sh#! /Bin/shA = 'echo 1 | SED's/\/g''Echo $ $./T1.shSed:-e expression #1, character 8:

Shell cut command usage

Similar to awk Functions Example 1 $ A = 'echo root: X: 0: 0: Root:/root:/bin/bash | cut-D: -F 1,5 'shuohailhl @ shuohailhl-PC/cygdrive/d $ echo $ aroot: Root In the preceding example, the root: X: 0: 0: Root:/root:/bin/bash command is

How to cancel redirection in a shell program

/*************************************** ******************************* Author: Samson* Date: 08/18/2012* Test Platform:* GNU Linux version 2.6.29.4* GNU bash, version 4.0.16 (1)-release (i386-redhat-linux-gnu) ************************************

Introduction to shell built-in command Exec

Shell built-in command Exec Shell's built-in command exec is very interesting. It will not start a new shell, but will replace the current shell process with the command to be executed, and clean up the environment of the old process. Other

Rpm-Pi in Shell

Common RPM parameters for these tasks !!! In Linux, you can run man rpm !!! It's only in English, or you can get Baidu RPM !!! I 'd like to paste a few below !!!! Common RPM commands 1. install a package # rpm-IVH 2. upgrade a package # rpm-uvh 3.

[Shell script learning] script task 7.18-7.21

Write a script:1. Create a directory/tmp/scripts2. Switch the working directory to this directory.3. Copy the/etc/PAM. d directory to the current directory and run the test command again.4. Change the owner of test and its files and subdirectories

Shell script learning: sed for regular expressions, tr

In Linux, The SED command is used to replace the text. The command that matches the regular expression can be replaced flexibly with SED, which greatly reduces the workload. It can be said that SED is the main force of replacement in shell scripts

File Processing and string processing in Shell

1. Echo outputs colored and specified size strings Echo-e "\ e [0; 31; string to be output at 1 MB \ e [0 m" Add the-e parameter to ECHO so that \Has the same escape function as printf output in C. \ E [0; 31; 1 M indicates that the output character

How do I calculate floating point numbers in shell?

It has the most basic mathematical computing capabilities in shell, such as expr and let. However, these operations can only process integer data. To calculate decimals, you must use the BC command extension. The following example shows how to

Run shell scripts during Mac and system startup.

MAC system startup process See: Http://hi.baidu.com/%CB%E6%B7%E7%B6%F8%D0%D01999/blog/item/271d20a694d7d49dd0435842.html   1 MAC boot STARTUP script or application (run shell script when the system starts) 1) if you want to start a Mac application

Unix shell programming (4)

Unix shell programming (4)   Cut commandYou can extract the required data fields from the data file or command output.Command Format: Cut-cchars FileChars indicates the characters to intercept, which can be numbers.File indicates a file. If file is

Shell time (string and timestamp conversion)

In shell, you can convert a string to a timestamp as follows:   Date-d "2010-10-18 00:00:00" + % s Output Format: 1287331200 The-D parameter indicates the time indicated by the specified string, and + % s indicates the output timestamp. The

Shell batch renaming

========================================================== ========================================================== ======== RENAME [-V] [-N] [-F] perlexpr [files]-V, -- verboseverbose: Print names of files successfully renamed. -N, -- no-actno

Shell script example

1. Mainly use awk to process two files Number = 0If [-F Level _ $ number. 'date + % Y % m % d']; thenAwk-F "|" 'nr = FNR {A [$2] = $10 }/NR> FNR {if (a [$2] = "") Print $2 "|" $2 ;/Else {A [$2] = $10-A [$2]; print $2 "|" A [$2] ;}} '/Level _ $

Basic Unix shell script Test

Basic Unix shell script Test1. Which of the following code lines will print your previous working directory to the screen? CA. Echo ~B. Echo $ pwdC. Echo ~ -D. Echo *2. Which of the following symbols can be used to redirect the command output to a

Learn shell-1

1. Using securitycrt in the options-> session Options dialog box, there are many options for emulation under terminal. the Linux server has different terminal simulation packages called the terminfo database, each type corresponds to a terminfo File

Shell starts another script for statistics. awk adds the current time in each row

Control script, Stat. Sh PID_NUM=$$PID_FILE=stat.pid#echo "pid : "$PID_NUMPROG_NAME=$0ACTION=$1usage() { echo "Usage: ${PROG_NAME} {start|stop|restart}" exit 1;}start(){ sh ./stat_run.sh & PID_NUM=$! echo "worker pid is " $PID_NUM

Shell script Development

Shell script compiling basics in Linux, although there are a variety of graphical interface tools, token is still a very flexible tool. Shell is not only a collection of commands, but also a very good programming language. You can use shell to

Total Pages: 541 1 .... 388 389 390 391 392 .... 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.