Using the shell to determine the local area network users have those

#!/bin/bashwhile true; do  for i in {100..120};d o     ping -c 2 -w 2 192.168.0. $I  &>/dev/null    if [  $? -eq 0 ];then      echo -e  "\033[32;40m  192.168.0. $I  is up.\033[0m "    else      echo  -e  "\033[32;40m 192.168.0. $I  is down.\033[0m"  

Shell Basics (1)

8.1 Shell introduces a simple point of understanding, is the system with the computer hardware to use intermediate media, it is only a tool of the system. In fact, there is a layer of stuff between the shell and the computer hardware that is the

Shell file Simple processing

Sometimes you need to simply deal with the file, with a few lines of shell script statements can be done, convenient, here to remember, while the next use. Combined with other people's blog and their own practice, but also the original

[Shell] Determine network conditions and add timestamps

A recent need to do a real-time statistical network situation and statistics of the error rate of the script, the following is a stackexchange on the plagiarism, although not fully satisfied, but only can output some information#!/bin/Bashhost=$1if[-

Shell level Two Menu

Today the weather is cloudy, a little bored, so boring to play like ...#!/bin/bash#date:2017-6-20#version:1.0#author:xcn ([email protected]) menu  () {Cat This article is from the "Little Rookie" blog, please be sure to keep this source

Shell Special variables

Positional variables $ $ Gets the file name of the currently executing shell script, including the script path if the script is executed with a path[[Email protected] shell]# sh n.sh n.sh[[email protected] ~]# sh/shell/n.sh/shell/n.sh[[email

Linux Shell & placed behind the startup parameters to set this process as a background process

& placed after the startup parameter to set this process as a background processBy default, the process is the foreground process, then the shell is occupied, we can not do other operations, for those who do not interact with the process, many times,

Shell Script Collation

Create the user who wrote the file650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/98/E0/wKiom1lBR5_gYB4HAAAoKuZARYU671.png "title=" Screenshot from 2017-06-13 19-44-27.png "alt=" Wkiom1lbr5_gyb4haaaokuzaryu671.png "/>Second, ping 172.25.2

Shell Script Rollup 2 delete files that have been created for more than 32 days

Shell Script Rollup 2 delete files that have been created for more than 32 days#!/bin/bash#date:2017-04-11#version:clear_ballcloud_back_v1.0#contents: removing the  /www /web/ballcloud_bakck/* , if the file is created above 32 day#cd

Shell Common monitoring scripts

1. CPU Idle ScriptTop-b-n1 |grep ' Cpu ' |awk ' {print $} ' |sed ' s/%//' |sed ' s/id,//'Assigning values to variablesCpu_id= ' top-b-n1 |grep ' Cpu ' |awk ' {print $} ' |sed ' s/%//' |sed ' s/id,//'Echo $cpu _idIf you only intercept integers, the

Shell Script Usage Tips 2

0--stdin Standard input1--stdout Standard Output2--stderr standard Errorredirectecho "This was a good idea" > Temp.txtTemp.txt content will be emptied first before entering "this is a good idea"Additionalecho "This was a bad idea" >> temp.txtCat

Shell grep Command Daquan

grep: For fuzzy lookups, in standard input or file  Format: grep [option parameter] ... PATTERN | FILE ...Option parameter Description:- E,--extended-regexp PATTERN is an extensible regular expression-E,--regexp=pattern using PATTERN for matching

Run your own shell script

Shell scripts can be directly./**.sh, or bash **.shI use the./**.sh to run a script of my own, and the following error will appear:[Email protected]:~$./pixel. SH bash:. /pixel. SH : Insufficient permissions [email protected]: sudo ./pixel. SH

Executing shell scripts in Linux

This article mainly introduces the 4 methods of executing shell scripts in Linux, that is, 4 ways to run shell scripts in Linux, and the friends you need can refer to the followingThere are several ways to bash a shell script, and now make a summary.

Shell determines whether a folder or file exists

The folder does not exist and is createdif [!-d "/data/"];thenmkdir/dataelseecho "folder already exists" fiFile exists then deleteif [!-F "/data/filename"];thenecho "file does not exist" Elserm-rf/data/filenamefiDetermine if a folder existsIf [-d

Shell pre-defined functions for Linux

$ $1-n The name of the current shell script the position variable $ #参数的数量 $* the value of all positional variables #? To determine whether the previous command succeeded, 0 for success, The non-0 is the failure---------------------------------------

Shell condition Test Statement if

Tag: Shell expression exists * * * Specify dir DIA statement return resultIf condition statement: The IF condition statement is divided into single branch structure, double branch structure, Multi-branch Structure-------------------------------------

Shell Application Tips

Shell Application TipsThe shell is a command interpreter, a layer of interaction between the kernel and the kernel. There are many kinds of shells, the one with the prompt that belongs to /bin/bash, and almost all Linux Systems default to this shell.

Shell script call jar package print multiplication table

#声明脚本#!/bin/bash#打印 "------CFB---------"echo "------CFB---------"#java环境变量Java_home=/usr/java/jdk1.8.0_11Classpath= $JAVA _home/bin#指定需要执行jar包的位置, you can set your ownJarpath=/home/haha/desktop#环境变量的标准格式Classpath= $CLASSPATH:

Shell--4, Shell array

Multiple values can be stored in an array. The Bash Shell supports only one-dimensional arrays (which do not support multidimensional arrays) and does not need to define the array size when initializing (similar to PHP).Like most programming

Total Pages: 541 1 .... 521 522 523 524 525 .... 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.