One day a shell command Linux file content Operation series-cat command detailed _linux Shell

Note: After the awk command, there are not too many complex commands, which are basic commands. Description Cat, which is the abbreviation of the word concatenate, outputs the contents of the file to stdout. When the redirection operator (> orWhen

Shell script programming Array _linux Shell

An array is a set of elements of the same data type arranged in a certain order, that is, a variable of the same type is named with a name and then numbered to distinguish their set of variables, which is called an array name, and the number is

The Select command in the Bash shell simply uses the example _linux shell

Objectivetoday I just wrote an automated packaging script, again using the bash shell, a good feeling of happiness. The main point here is to introduce the Select command, which can help us complete the menu selection function. FormatI am also the

Example of eval usage in the shell _linux shell

Function Description: Tell the shell to remove the eval parameters, recalculate the contents of the parameters.Syntax: eval [parameters]Supplemental Note: Eval can read a series of parameters and then perform them according to the characteristics of

Kill the shell script code for a particular process _linux shell

1. Methods of primitive violence Copy Code code as follows: mylinux:/home/zhanhailiang/public_html # Killall Nginx 2, gentle point of approachFinds the PID for the specified process and kill|kill-usr1 it off Copy Code code as

Using shell script to realize automatic switching of intranet and extranet to achieve high availability _linux shell

The first description of our configuration file, are similar format, if the intranet is 192.168.0.3, the extranet is 123.123.123.123, the configuration file is as follows: $db [' salver '] [' hostname '] = ' 192.168.0.3:3306 ';$db [' salver '] ['

Shell script implementation to determine whether the IP address in an IP segment code sharing _linux Shell

Cat ipcalc.sh #!/bin/bash ip=$1 If [-Z $IP] then echo-e "\e[31;42m sh ipcalc.sh IP \e[0m" exit fi while read MASK do min= '/usr/bin/ipcalc $MASK |awk '/hostmin:/{print $} ' max= '/usr/bin/ Ipcalc $MASK |awk '/hostmax:/{print $} ' min= ' echo $min

The frustrating system () function in awk _linux the shell

Find a special embarrassing fact. I worked hard to Baidu data, want to use rewrite to achieve different domain name source station after the failure of automatic jump function, but the whole idea of missing a serious problem. In my mind, make a

Implement server monitor and alarm small script with Shell+sendmail _linux shell

This email alert script is everywhere, a lot of use of sendmail, Postfix, feel a bit overqualified, and some use Perl net::smtp and AUTHEN::SASL module, but I use Perl is not good, The old send out some baffling mails (for example if (a>1) {print (a)

A summary of the method of shell script passing parameters _linux Shell

svn

First, receive the fixed length of the parameter Copy Code code as follows: [Root@svn shell_example]# Cat params.sh #!/bin/bash #传参测试脚本 echo "My name is ' basename $ ' I ' called as $" echo "My I-parameter is: $" echo "My

Shell script realizes whether the rsync data is transmitted over the _linux shell

Today there is a server A to transfer all the Web site program to another server B up, but away from work time is only 1 hours, in order to work on time, simply wrote a shell script to monitor whether there is transmission, I first in the server a

In the shell script, implement switch user and execute command operation _linux Shell

Today, my company colleagues came to me and said that I was going to execute the Python script on the server with another user, but it was always done by the root user in the crontab, so I thought of a lazy way to use the shell script to switch to

Shell script to slow down system time (used when testing the server) _linux Shell

The company's recent server testing, the need to constantly adjust the system time, one or two is ok half, a little more points, on a variety of entanglements, the author of these several sets of the author is going crazy. Eldest brother: All speed

Create a daemon code instance in a template _linux shell

Copy Code code as follows: #include "Wrap.h" #define MYDOMAIN_FLAG "/tmp/.mydomain_log" void Domain_end () {Unlink (Mydomain_flag);} int Domain_init () {int FD;Fd=open (mydomain_flag,o_rdwr| O_creat| o_excl| O_APPEND,0600);if (fd==-1)Err_

Linux Nginx log Script _linux Shell

Task ScheduleCrontab-l1 * * * */home/dongnan/sh/split.sh >>/home/dongnan/sh/cron.log 2>& Nginx Logls/var/log/nginx/20130730-access.log.gz 20130801-access.log.gz 20130803-access.log.gz20130730-error.log.gz 20130801-error.log.gz 20130803-error.log.gz2

Ubuntu Server configuration apache2.4 speed limit function shell script sharing _linux Shell

The process is written in a script, the principles are written in the comments, you understand. One-click operation is sudo bash xxx.sh Copy Code code as follows: #!/bin/bash #cd到临时目录创建配置文件 Cd/tmp (Cat Setoutputfilter

Shell script automatically updates hosts to achieve wall-free access to Google_linux shell

The last time we sent a Python update Google hosts script, today saw someone sent a shell to get Google hosts script, I took to a slightly more simple processing, the following gives you the shell version of the update of Google hosts script.

How to use shell programming hollow lattice _linux shell

1. When defining a variable, no spaces can be left on either side of the = number.eg:Gender=femal ———— RightGender =femal ——— –wronggender= femal ——— –wrong2. Conditional test statement [Both sides of the symbol must be left blank.eg:if [$gender =

A simple, fully automatic installation LNMP server environment shell script sharing _linux Shell

This script has been used for more than a year on the production server, and this script advocates simplicity and beauty, and requires only one script to automatically configure LNMP on any server that has a network. In the script execution

Shell script implementation upload zip compressed file to FTP server _linux shell

Copy Code code as follows: #/bin/bash # Creator:lihuibin # date:2014-03-10 16:45 # Desc:upload file to FTP Hosts= "192.168.56.100" Port=21 User=test Pass=testpwd Work_path= "/var/www/cms" Packname= "Publish" #hosts =$1 #port =$2

Total Pages: 541 1 .... 267 268 269 270 271 .... 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.