Two scripts to check Linux network status _linux Shell

First, through the timing of email to detect network connectivity Copy Code code as follows: #/bin/bash echo "Daily Test mail" > State.txt Mail-s Server_state Abc@jb51.net Rm-df./state.txt ~ Crontab-e Add the following

Send log collation number via SMS shell script _linux Shell

Copy Code code as follows: #!/bin/bash #telno for the query number list file #sendsms. Log send result file for SMS #1 Rep sent successfully Query_sms () { >submit_telno >delivered_telno >fail_delivered_telno Cat Telno |while Read line

Shell script Implementation automatic input password login server _linux shell

Use Linux Programmer to enter password This behavior must be not unfamiliar, under Linux to the user has the strict permission limit, does many things crosses the permission to have to enter the password, for instance uses the super user to execute

4 ways to implement SSH automatic login _linux shell

ssh

1. Automatic Ssh/scp method A is a local host (that is, a machine used to control other hosts);b is a remote host (that is, a controlled machine server), if IP is 192.168.60.110;Both A and B systems are Linux. To run a command on a:# ssh-keygen-t

Debugging techniques built into bash scripts _linux shell

Scripts written in Bash can also be debugged, just like Python,perl and other interpreted languages. Create a new script named Servinfo and add executable permissions: Copy Code code as follows: $ VI Servinfo #!/bin/bash echo

How to display Git branch names in the shell prompt _linux Shell

One of the benefits of Git is that the branch management of the code becomes an extremely convenient thing, the branch only retains the difference, does not have to copy any files, does not connect the network, quickly creates, uses is deleted. The

Methods to get Process IDs in shell scripts _linux shell

Question: I want to know the process ID of the script shell in the run. How do I get the PID in the shell script? When I execute the shell script, it starts a process called a child shell. As a child of the main shell, the child shell runs the

UNIX programming create prefix fixed temporary file code share _linux Shell

Parameters:Pathname, the path file name of the temporary file is stored, and the manual free () is required.Dir, the path to the temporary file, if the TMPDIR environment variable is not empty, this parameter is ignored and the environment variable

Shell script code for file encoding in bulk conversion directory _linux Shell

A case of a batch conversion directory of File encoded shell script code. Requirements Description:As a result of turning Linux from Windows, many original win under the GBK file needs to be converted into UTF8. The following script only judges

Linux use Select to implement precise timer detailed _linux shell

When writing programs, we often use timers. First look at the Select function prototype as follows: Copy Code code as follows: int select (int Nfds, fd_set *readfds, Fd_set *writefds, Fd_set *exceptfds, struct timeval *timeout);

Shell script to implement a variety of ways to arrange the contents of the file (shuffle problem) _linux Shell

Shuffle problem: Wash a pair of poker, what good way? Can be washed evenly, and can wash quickly? What is the efficient implementation of a disorderly arrangement relative to a file? Chinaunix is indeed the place where the Shell masters are

GETCWD Cannot access parent directories error resolution _linux Shell

Copy Code code as follows: [Root@web-server php]#/etc/init.d/httpd Restart Shell-init:error Retrieving current Directory:getcwd:cannot access parent directories:no such file or directory This error indicates that the GETCWD command could

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 =

Examples of different data transformations in shell scripts (binary, octal, 16, base64) _linux Shell

The shell can represent different data in the system without invoking the 3rd party command. The following presentation method is summarized here. The default value of the shell script is handled by the 10 number, unless the number has a special

Linux database backup and share _linux Shell via FTP upload script

Copy Code code as follows: #!/bin/bash #author: 505056357@qq.com echo "Backup Job Start" #设置要备份的网站目录, that is, the root directory of the Web site File=/home/wwwroot/default #设置本地备份目录, for storing the packaged files

Share a useful iptables script (various filtering notation references) _linux shell

This iptables script is good, very practical, according to the actual application can be changed to use their own. Share it for everyone to refer to. The original author anon. The source code is as follows: Copy Code code as follows:

Two ways to shell command substitution _linux Shell

Command substitution means that the Shell executes a command and replaces the command substitution with the result of executing the command. There are two ways to replace a command: 1. Use backtick symbols (i.e. ..., inverted quotes, accented

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

Methods for printing color fonts and color backgrounds using echo in the shell _linux shell

It's fun for the terminal print in the shell!First know that the end of the shell print has echo printf is commonly used is echo slightly; Note: Font Color reset = 0, black = 30, red = 31, green = 32, ***=33, blue = 34, magenta =35, cyan = 36,

Awk implements left, join query, remove duplicate values, and local variables explain examples _linux shell

Recently saw a few good small examples in the forum, for learning awk is still helpful, here in detail A. A LEFT join query in a similar database Copy Code code as follows: [Root@krlcgcms01 mytest]# cat A.txt//a.txt aaa 222 BBB

Total Pages: 541 1 .... 146 147 148 149 150 .... 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.