Use shell scripts to view memory usage on Linux

Memory utilization as above = "-/+buffers/cache:used"/"mem:total" = 6293404/16333656For the free command, the following formula is available:Total = used + Free;(-buffers/cache) used = mem:used-mem:buffers-mem:cached;(-buffers/cache) used=

Beginner Linux's Simple shell

First occupy the pit, back to complement the perfect ha#!/bin/bash# program:# This program was used to stop Tomcat.# History:# 2016/09/11 XH First releasePid= ' Ps-ef|grep tomcat|grep-v Grep|awk ' {print $} 'if [$pid]ThenEcho ' Tomcat is already

The Linux Shell Series Tutorial (17) Shell file contains

This article is part of the Linux Shell Series tutorial (17), more Linux shell tutorials: Linux Shell Tutorials Through file inclusion, you can reference the contents of other files, or you can separate complex content to make the program

Shell script, how to monitor the contents of the file under the directory is modified.

md5

The first approach is to use CMP for comparison[Email protected] bo]#ls1. html2. html3. html4. html5. html6. html7. html8. html9. htmlCat.SH[email protected] bo]#Cat Cat.SH#!/bin/bash[! -f/root/wyb/bo/Cat. log] &&Cat*.html >/root/wyb/bo/Cat. LogCat*.

There are four ways in which the Bash Shell's arithmetic operations

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1: Using expr external programAddition R= ' Expr 4 + 5 'Echo $rAttention! ' 4 ' + ' 5 ' There should be a gap between the threeR= ' Expr 4 * 5 ' #错误Multiplication r= ' expr 4 \* 5 '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2:

Shell script, a shell start-up process.

#一个shell的启动流程 #shell have some variables, called environment variables, which can be inherited, #比如父shell有 $UID, child shells can have, and inherit the parent shell. #正常我们声明一个变量, a=1, in the child shell, A is empty, and the variable declared by

First knowledge of the shell

1. What is a shell?The shell is in the outer layer of the kernel, which is responsible for receiving commands entered by the user, interprets the commands as kernel can understand, then executes by kernel and returns the results back to the default

Bash Shell common shortcut keys

Some of the more commonly used bash shell commands are listed below for forgetting.For detailed commands, please refer to: https://github.com/LinuxTOY/linuxtoy.org/blob/master/content/bash-shortcuts.mdView history Commands:Up and Down keysCommand

Implementation of shell Multi-process

Requirements: Multiple scripts do not interfere with each other and run simultaneously, saving timeRookie level implementation:#!/bin/shDir= "/data/test"$dir/sbin/test1.sh >>$dir/log/test1.log 2>&1 &$dir/sbin/test2.sh >>$dir/log/test2.log 2>&1 &$dir/

Shell Script Learning Summary 12--system signal

Signal is a process communication mechanism in Linux system. We can use a specific signal to interrupt the process. Each signal is associated with an integer value.The KILL command can be used to send a signal to a process, while the trap command

Shell's underlying syntax

Shell variables: Local variables and environment variablesBasic elements:#! /bin/bash#VariableProcess ControlHome: The current user's home directoryPath: The current user's executable file search pathLANG: The default language the program should

Zookeeper under the shell operation

Zookeeper under the shell operationEnter%zk_home%/binperform zkcli.sh [-server Ip:port] #如不指定, then connect the nativeCreate:create [-S] [-e] path data ACL #创建数据节点-----s indicates that the sequential node-e represents a temporary node, and two are

Eval in the shell

Eval syntaxEval arg1 arg2 ...The function of Eval is to take the following parameters Arg1 Arg2 and so on as a pipeline, and then re-execute the shell process pipeline (about pipeline, see http://www.cnblogs.com/chaoguo1234 /p/5724321.html)Suppose

Choose login SSH using shell scripting custom implementation

Create two scripts in the system bin directory, respectively, Pssh tsshPssh#!/usr/bin/expect-fSet IP [lindex$argv 0]set Port [lindex$argv 1]set Password [lindex$argv 2]set TimeoutTenspawn ssh [email protected]$ip-P$portExpect {"*yes/no"{Send "yes\r";

Shell Programming while

Script Programming:Sequential structureSelect structureIfCaseLoop structureForWhileUntilWhile loop: For scenarios where the number of cycles is unknown, exit conditions are neededGrammar:While CONDITION; DoStatement...Done Calculates the and of all

My shell script

Problem: There are 600 IPs in the ip.lt file, 3 document templates, and three document name structures are "ip+ series of Strings", Requirements: 1. Divide 600 IPs into 3 points, create 600 documents based on three templates, same name structure as

The progress bar and maximum minimum average under the shell

Progress barC Language progress bar reference my original article blog-> progress barFunction proc () {     i=0      str= '       arr= (' | ')   '/'   '-'   ' \ \ ')      index=0     while [   $i  -le 100 ]     do          printf  "[%-101s][%d%%][%c]

Simple application of shell arrays

1. [email protected] seripts]# cat array.sh2. #!/bin/sh3. zhang= (4. wujiangping5. Shuzhaoqiang6. Renhepeng7. peijiaying8. zhangyiling9. ). for (i=0; iOne by one . Do. echo "This was num $i, then name is ${zhang[$i]}".

Shell Script---Array

Array definition: The so-called array, is the same data type of elements in a certain order of the set, that is, the finite type of the same variable with a name command, that is, these variables are defined as a group, they do not have their own

Shell script Programming-arrays (array)

The difference between an array and a variableVariables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, equivalent to a collection of multiple variablesArray = array name + indexIndex:

Total Pages: 541 1 .... 464 465 466 467 468 .... 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.