Shell check string in Linux is not a valid IP

Example The code is as follows Copy Code zj@zj:~/script/cushell/08.11.04$ Cat checkip.shView Plainprint?#!/bin/bashPrinterr () {echo "Incorrect IP format."ReadipChkip}Readip () {Read-p "Your IP:" IP}Chkip () {echo "$IP" |

Using shell to periodically clean up Web cache data scripts in Linux

After testing, the script does not set up!! The site uses a number of methods to accelerate (REDIS\CDN), this reduces user access to back-end MySQL pressure, as well as the front-end speed is not very good problem, the user requested to all the

Linux shell command to overwrite entire disk with small files

Suppose we are confronted with a problem like this, the company's key data copy to the test server, after it is deleted directly, still worry that the server vendor can restore it, even through Fdisk reformatting, there is still the risk of recovery,

Linxu the file shell script before the specified time is deleted

Recently the World Cup has come, has been busy between work and the World Cup, there is no time to manage my blog, today can only be the whole simple small shell to everyone. The company asked to delete one months before the backup file, so that the

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

Linux Shell Curl Command gets the HTTP status code

By curl the-w parameter we can customize the output of the curl,%{http_code} represents the HTTP status code The code is as follows Copy Code # curl-i-M 10-o/dev/null-s-W%{http_code} www.111cn.net The above

A summary of common methods for Linux shell commands

Date# Take the day beforedate-d ' 1 days ago ' +%y-%m-%d Order, E-Name, set function: (alias)Alias Ll= ' Ls-al ' Some special values$$: (for this shell PID)$!: Get the process pid of the subprocess, for example the Nohup command can get the PID$: (

Solve the problem of CentOS shell display-bash-4.1$ does not display the user name path

Problem Description: CentOS A new user, log in after the information of the shell script is as follows: Linux CentOS Shell display-bash-4.1$ does not display the user name path solution Ps: If you mistakenly delete files in the user directory, it

Bash Shell programming Exercises

1. Create the executable file t2.sh and print "Hello world!"[Email protected] ~~ $ cd tscripts/'#!/bin/bash' >>' echo "Hello world!" ' >>~/tscripts $ chmod +x *~/tscripts $./t2.sh Helloworld!2. Methods to run the executable file in 3[Email

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 Contact 2

See if there are any custom users (ordinary users) on your Linux system, and if so, how many are there?[email protected] ~]# cat 6.sh#/bin/bashN= ' awk-f: ' $3>=500{print '/etc/passwd |wc-l 'If [$n-gt 0];thenecho "$n Common users"Elseecho "No common

Linux-shell Exercises (I.)

1, realize the bulk add 20 users, the user name is user1-20, password is user+123#!/bin/Bashcount=$1if[-N"$count"]then for((i=1; i)) DoUseradd-d/home/user_$i-s/bin/bash user_$i; Echo User_"$i"123|PASSWD--stdin user_$i; DoneElseEcho"$count is

[Shell] Swoole_timer_tick and crontab combination for scheduled tasks and monitoring

There are three main steps to completing tasks and monitoring manually:1. mission_cron.php (timed automatic task script):PHP /* * * Automatic task timer (5s execution). * Swoole_timer_tick resolution of second-level timing; * To adjust, note the

Linux Shell Usage Summary

Why do scripts use the./+ script name to execute the scriptUnderstand:Because if the script name is used directly, then the Linux system will go to path path to findsuch as go to/bin usr/bin, such as find, this time will not find the script name,

What does "-e,-d,-f" mean in a shell under Linux?

File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if

Peanut Shell Use Tutorial

Inadvertently see the router inside there is a dynamic domain name, and later on-line a check that it is possible to establish a personal website, and then allow other users on the network to access their own servers, such as their own establishment

Configure shell script for nginx startup in linux

1. Added the shell script vi/etc/rc. d/init. d/nginx. The code is as follows:Copy code #! /Bin/bash# Chkconfig: 35 85 15# Description: Nginx is an HTTP (S) server, HTTP (S) reverseSet-ePATH

Shell script deletes the backup file instance one day ago

Today, the company asked me to copy the backup files on the server to the internal server, and as long as they are up-to-date, well, what is the ideal goal of O & M personnel, that is, what can be done by computers, never do it by yourself.System:

Script for automatically modifying the nic name shell in CentOS 7

Code directly!#! /Bin/sh [-F/etc/init. d/functions] &./etc/init. d/functions### Modify the Nic configuration file nameFunction net (){B0 =-1Cat/proc/net/dev | grep ':' | grep-v 'Lo' | cut-d:-f1 | sort>/tmp/net_name.txtDoC0 = $ lineB0 = 'expr $ b0 + 1

Thin + nginx shell script automatically started after linux restart

After using thin or rbenv, many friends found that rails could not be started happily with linux startup.Remember the following points:1. Make the PATH contain the rbenv PATH2. Check the/var/logs/boot. log file during debugging.The specific process

Total Pages: 541 1 .... 351 352 353 354 355 .... 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.