Two scripts to check port conditions under BASH shell

These days need to do Linux TCP port check script, found that netstat, NC command, although good, but not intuitive, and the port is a bit more trouble to check, hands-on learning to do two scripts. One is to check the port condition in the form of

Shell Share mkdir command

The common options directory is present without an error (at this time there is no effect on the directory), there is the creation of mkdir-p, if there is a need to create a parent directory when creating a directory when the parent directory is

Shell string Equality Comparison, note the processing when the string is empty

if ["$test" x = "Test" x]Here are a few key points:1 with a single equals sign, two equals signs can be2 Note that there is a space on each side of the equal sign: This is the UNIX shell requirement3 Notice the last X of "$test" X, which is

Using shell scripts to check server hardware information

1, in order to facilitate the query server hardware information, will need to query the content into the shell footsteps, output their desired format. In fact, it is through the dmidecode command output, and then through the sed,awk,cut command

Shell string Processing

Output the top 10 system user names and UID numbers of the current system to the screenhead/etc/passwdString interception1${variable name: Start position: Length}echo ${variable name: Start position: Length}Variable name =${variable name: Start

Good command of HDFs shell access

The main purpose of the HDFs design is to store massive amounts of data, meaning that it can store a large number of files (terabytes of files can be stored). HDFs divides these files and stores them on different Datanode, and HDFs provides two

Shell condition-loop-branch-function

Shell Process Control (if structure loop structure branch structure)Controlling the execution of scriptsProcess control can be nested with each other, or they can nest themselvesJudging result execution according to condition condition---------------

Linux under Limit shell:rssh and Scponly

Restricting the shell, like Rsh and Scponly, allows the system administrator to restrict what Linux users can do, and you can create users that will be allowed to copy files through the SCP, but will not be allowed to log on to the system's command

Linux system monitoring shell script

The code below, implements some common monitoring variables of the Linux system, shares to everybody @. [Email protected]#=============================# #Filename=system_monitor.SH#Author: foxsir#date: .- Geneva- the#=============================##!/

Shell Process Control

Shell Process ControlUnlike Java, PHP and other languages, SH's process control is not empty, such as (the following is the PHP Process Control notation):phpif(isset($_get["Q"])){ search(q);} else{//Don't do anything } You can't write

Shell Input/Output redirection

Most UNIX system commands accept input from your terminal and send the resulting output back to?? to your terminal. commands usually read input from the standard input, which is the default terminal . Standard output, which is the terminal by

Shell Basic Operators

The Shell, like other programming languages, supports a variety of operators, including: Arithmetic operators Relational operators Boolean operator String operators File Test Operators Native Bash does not support

Shell programming: Automatically format the hard drive and mount it

This script is not a complete script, has not implemented automatic mount partition, each disk is divided into 2, 1 partition for the 1g,2 partition of 2G.#!/bin/bashCount= ' fdisk-l|grep/dev/sd.*|grep-v '/dev/sda.* ' |wc-l 'I=1While [$i-le

Function of Shell programming

The definition of the shell function is almost the same as the normal C language function.function () {}The return value of the Shell function can be displayed, and if there is no return then the execution result of the last statement will be

Raid and one of the Mdadm commands (including shell display font color, etc.)

Write a script:1) display a menu to the user:d| D) show disk usages.m| M) show memory usages.s| S) show swap usages.QUIT|Q) quit.2) Display the appropriate content when the user is given an optionWhen the user chooses to complete, displays the

16th Shell Script Basics (i)

1. What is a shell?The shell is a command interpreter. is an insulating layer between the operating system kernel and the user. For a Linux system user, the shell is the most basic tool for you to navigate a Linux-like system. All system commands

Shell script: Bulk Modify file name (delete characters in file name)

Shell script: Batch modify file name (add character in file name)The previous article on the bulk modification of the file name (the file name of the addition of characters), the work also exists such a requirement, batch modify the file name,

Shell's If statement

First, the logical operator Logical Volume Label Express meaning 1. About the file and directory of the detection of Logical volume label! -F Common! Detect if "Archive" exists eg:if [-f

JMeter Bean Shell Use (ii)

Previous JMeter Bean shell Use (a) a brief introduction of the bean shell in the next jmeter, this article is a supplement to the above, mainly summarizes the common scenarios and methods, I believe these basic can cover most of the needs. This

Array of shell script programming

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 the set of the variable is distinguished by a number, which is called the array name, and the number

Total Pages: 541 1 .... 225 226 227 228 229 .... 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.