Shell scripts for Linux admin memcached

If memcached has been installed in Linux and is deployed to the/usr/local/memcached path, next we will begin to install service management scripts for it to start and stop. First of all, through VI in the/ETC/RC.D/INIT.D path to create a new script

Linux Resin launch shell script

The code is as follows The code is as follows Copy Code [Root@client01 ~]# Cat/etc/init.d/resind#!/bin/sh#created by Teddylu at 2014-12-12#used to startup for resin version 3.1#chkconfig: 345 85 15#set up environment

Linux shell gets SSH port number method

Lattice, as follows: The code is as follows Copy Code [root@myvps1697 201407]# netstat-ntpl|grep sshd|grep-v grep |awk-f: ' {print $} ' In order to solve the problem of space, the 3 of my group have asked all

Bash vulnerability shell script repair in Linux

The code is as follows Copy Code #/bin/bash #Author Alex Fang. Updates may apply soon. Clear echo "Press AnyKey to continue ..." $anykey; Read AnyKeyecho "bbbbbbbbbbbaaaaaaaaaaaaaaaaaaaasssssssssssssssssshhhhhhhhhhhhhhhhhhhh!"echo

Shell monitoring iptables rules are changed

System: CentOS 5.xScript content: The code is as follows Copy Code #!/bin/bashif [!-F. Count];thenIptables-l-n|md5sum|awk ' {print $} ' > ~/.countExit 1ElseIptables-l-n|md5sum|awk ' {print $} ' >~/1.txtDifffile= ' diff ~/

Using shell scripts in Linux to view the process of seizing swap

To view the script that the process occupies the swap partition The command script is as follows: The code is as follows Copy Code For i in ' Cd/proc;ls |grep "^[0-9]" |awk ' $ >100 ';d o awk '/swap:/{a=a+$2}end{print '

Generate random numbers in the shell

Command Introduction$RANDOM # #一般产生4-5 digitsColumn description[Email protected] shell]# echo $RANDOM9926[Email protected] shell]# echo $RANDOM16517[Email protected] shell]# echo $RANDOM3839[Email protected] shell]# echo $RANDOM58572. Generate

Shell-based if statement

In determining the size of a value in addition to (()) can be used in the form of [] but can not use;, If statementif Judgment statement; ThenCommandFiIf,else statementsif Judgment statement; ThenCommandElseCommandFiIf Elif statementIf Judgment

Shell common list of special variables

Variable Meaning $ Gets the file name of the current execution shell script $n Arguments passed to the script or function. N is a number that represents the first few parameters. For example, the first

Shell command Daquan

Shell Command CollectionCCat Zdd Browse the contents of a ZDD fileCat Zdd1 Zdd2 Browsing the contents of multiple filesCat-n ZDD Browse the contents of a file Zdd and display line numbersCD back to the start directory, that is, just logged into the

10th Shell Programming (2) _ Character intercept command

2. character intercept commands2.1 Cut field Fetch command (grep fetch row, cut fetch column )(1) Cut command:#cut [options] File nameOption:-F Column Number: Extract the first few columns;-D delimiter: Splits columns by the specified delimiter,

Shell Programming (iii)

Bash basic features: command line expansion~: Automatically expands to the user's home directory, or the specified user's home directory;{}: A comma-delimited list of paths can be hosted and can be expanded to multiple paths;For example:/tmp/{a,b}

Split usage in Linux shell

[email protected] ~]# split [-BL] File PREFIXParameters:-B : Can be divided into the file size, can be added units, such as B, K, m, etc.;- L : Split by number of rows.Example:Example One: my/etc/termcap has more than 700 k, if want to divide into 30

Shell, not successful

###### #时钟#!/bin/bashMin=1Hour=1for ((sec=5; sec>=0; sec--))DoEcho-ne "${hour}:${min}:${sec}s End"Sleep 1Echo-ne "\ r \ r"While ["$SEC"-le "0"-a "$MIN"-ge "0"]DoEcho-ne "${hour}:${min}:${sec}s End"Echo-ne "\ r \ r"((min--))Sec=60While ["$MIN"-lt "0"-

Hbase Shell Operations Summary

Enter HBase command line./hbase ShellShow tables in HBaseListCreate a user table with info, data two column familiesCreate ' users ', ' info ', ' data 'You can also use the This command:Create ' users ', {NAME = ' info ', VERSIONS = ' 3 '}Insert

Shell scripting Exercises (12.12)

Write a script, create a folder, enter a folder, and then use the loop to create a sequential file in the folderIdea: 1. Create the specified folder and go to the folder2. Specify a variable with a value of 0 to allow this variable to be recycled3.

Bash Shell array variables

First, define the array variable1. Grammar(1) arrayname= (parameter1 parameter2 ...)Example 1, define an array named name, with a value of Claire,obama,georgeName= (Claire Obama )(2) Arrayname= (Parameter1Parameter2...)Again we change example 1 to

Python3 implementation--rebound shell

First, demonstrate the effect of rebound shell0. Look at the Python version650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8B/90/wKioL1hRTinAlo_nAAASu8q0u_A128.jpg "title=" Python.jpg "style=" Float:none; "alt="

Whether the files on the dual-ratio server are consistent Shell scripts

At work, you sometimes need to compare whether the files are consistent. You can use the following script (relatively simple): share it and hope to help friends who have the same requirements ~ The code is as follows:Copy code #! /Bin/bash#

Shell script for Nginx log cutting

By default, Nginx access logs are stored in a file. After a long time, the log content becomes unusually large. It is not conducive to archiving, backup, and analysis of log files. You can run scripts on a daily basis to automatically cut logs and

Total Pages: 541 1 .... 408 409 410 411 412 .... 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.