Common Linux Shell skills (10)

20. Use the shell command in the pipeline to obtain system running data: 1. output the five commands that occupy the most memory in the current system : #1) run the ps command to list all processes running on the current host. #2) The fifth

Shell interview questions (1) to be continued grep Common commands Regular Expressions 30 minutes getting started tutorial grep Common commands sed commands simple use [command tips] lsxargs command lsof Common commands

Replace file1 with the actual file as follows 1. query the row number of the empty row in file1.Grep-n "^ $" stl_stable_sort.ccRefer:Common grep commands 2. query the rows ending with ABC in file1.Grep-n "^. * ABC $"

Summary of common Linux shell commands

1. find Find pathname-options [-print-Exec-OK] let's take a look at the parameters of this command: path of the Directory searched by the pathname find command. For example, use "." To represent the current directory, and use "/" to represent

Upload awk variable to shell

My colleague asked me a question about awk today. It means that the several rows of data obtained through the awk operation are not fixed. You need to store the obtained rows of data in an array and do not want to use loops. After one afternoon's

Use shell + sendmail to implement the server Monitoring Alarm script

This e-mail alert script is widely used. Many of the sendmail and postfix scripts are used, and some of them are used in perl's NET: SMTP and Authen: SASL modules, but I am not using perl well. I always send some inexplicable emails (such as if (a> 1

Kill the shell script code of a specific process

1. Methods of raw violence Copy codeThe Code is as follows: myLinux:/home/zhanhailiang/public_html # killall nginx 2. gentle approachFind the pid of the specified process and kill | kill-USR1 Copy codeThe Code is as follows:

Linux shell Array

Bash shell supports only one-dimensional arrays, but there is no limit on the number of parameters. Declare an array:Declare-a array(In fact, you don't need to declare it. You just need to assign values to variables in the array mode. BASH knows

Shell scripts for two backup Databases

Back up database shell script 1 Copy codeThe Code is as follows :#! /Bin/bash # Specify the running script shell # Run the script to grant the user the execution permission Bakdir =/backup Month = 'date + % m' Day = 'date + % d' Year = 'date + %

Tips on shell programming

1. print some header informationCommand ............Dilimiter Use the content in the demarcation symbol dilimiter as the standard input of the commandIt is often used in echo commands, which avoids the use of an echo command when no line is output,

Introduction to searching and replacing Shell script Learning Guide

3.1 search for textGrep: use the basic regular expression (BRE) defined by POSIX ).Egrep: use an extended regular expression (ERE ).Fgrep: Quick grep. Use an optimized algorithm to match a fixed string instead of a regular expression. 1992 POSIX

A shell script used to count the hard disk usage of CPU memory

Copy codeThe Code is as follows :#! /Bin/bash # This script is used for describle CPU Hard Memery Utilization Total = 0 Idle = 0 System = 0 User = 0 Nice = 0 Mem = 0 Vmexec =/usr/bin/vmstat Which sar>/dev/null 2> & 1 If [$? -Ne 0] Then Ver = 'vmstat-

Shell-written alarm count control and recovery sample code

I am also a newbie. I am a little old-fashioned. I am a good trainer. It is a reference for beginners. Copy codeThe Code is as follows :#! /Bin/bash If [$ succ_ping-gt $ (ping_count-1)]; then If [-f./alarm_file/alarm _ $ host];

Shell script code for concurrent database stress testing

Copy codeThe Code is as follows :#! /Bin/bash #********************************# # Run fun in the concurrent background # # For wanggy 2012-01-25 # # Note :# # Fun_num number of times the fun function runs in the background # # SQL _num SQL

Shell file test

File Type: -F: determines whether the file is a common file.-D: determines whether the directory is used. -B: determines whether a device file is a block.-C: determines whether a device file is a dual-character device file.-S: Determine whether the

For Loop in shell programming

For is an important loop statement in shell programming: Syntax 1: For variable in list Do Action ..... Done List: ① 'Seq 1 10' #1-10 ② {1 .. 10 }## 1-10 ③/Etc/rc. d/rc3.d/K * # All files starting with K in the directory will be cycled once. ④

While loop in shell programming

While Syntax: While [condition] Do Command ........ Done Special while usage: ① While true | while ;; Do Done ---------------------- endless loop ② While read line_value Do Done Exercise: Use the while statement to capture bash

SHELL get the number of milliseconds

Conditions are required for exporting data from mongodb Currently, time is stored in milliseconds. Therefore, you must obtain the number of milliseconds from the shell. The first thing to say is the + % s parameter of the date command. I searched

Automatic Upgrade script (shell)

Overview Multiple duts are usually used during testing, saving a lot of time to upgrade the new version of the work script.Code #! /Bin/bash # download new version, scp to dut and upgrade # author: godlaughing url = $1 wget $ url download_dir

ADSL + peanut shell + Serv-U personal website creation

 I am a Shanghai Telecom ADSL Broadband User and use ZTE ADSL 831 MODEN to access the Internet.I am an old man and I don't want to know much about it technically. I just drew a gourd image. After two weeks of hard work, I initially set up my

Remotely Managing vmware view pool users with power shell

  1. Install the system patch of power shell V2.0 on the client. The patch number is KB968930, which includes winrm and powershell 2.0.   2. Set the view connection server to a trusted host of winrm:   Ps c: \ set-item wsman: \ localhost \ Client \

Total Pages: 541 1 .... 481 482 483 484 485 .... 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.