Shell script recursive traversal directory and subdirectory example share _linux shell

The script that recursively iterates through the directory with the shell writes recursively traverses the specified directory and prints the file name under the directory. Example 1: Copy Code code as follows: #!/bin/sh function

Shell script forwards 80 port packets to Node.js server _linux shell

Note: Do not plan to use root user directly to run Node.js service! This will lead to an unpredictable security issue!However, using port 80 as the HTTP default port is a habit that has lasted since the age of Ms. People on the Internet talk about

Linux statistics the number of files under the current folder, the number of directories _linux shell

1) Statistics the number of files under the current folder Copy Code code as follows: Ls-l |grep "^-" |wc-l 2) Statistics the number of directories under the current folder Copy Code code as follows: Ls-l |grep

Shell implementation to determine if a process exists and restart script sharing _linux Shell

Concise version: #! /bin/bash # author Caoxin # time 2012-10-10 # Program: To determine whether to exist and restart function check () { count= ' PS -ef |grep |grep-v "grep" |wc-l #echo $count if [0 = $count];then nohup

Shell script Implementation bulk download network picture code sharing _linux Shell

Recently, in order to do a weather forecast project, need to download some weather icons from Yahoo, but because of more than 80 icons. The icons are stored on the Yahoo image site. Thunder does not support HTTPS downloads, although it can be

Shell Script Programming Circular Statement Learning notes _linux Shell

This blog is simple to look at the loop statements that Shell programming uses, including for loops, while loops, until loops, for behind and a variable, and then a collection that assigns things to this variable, each loop, like a foreach in Java.

Nagios distribution file Implementation code _linux shell

Nagios is an open source free network monitoring tool, can effectively monitor Windows, Linux and UNIX host State, switch routers and other network settings, printers and so on. When the system or service status is abnormal, send an email or SMS

A concise tutorial on shell script for loop statements _linux Shell

Like other programming languages, the shell supports A for loop. For loops The general format is: Copy Code code as follows: For variable name in list Todo Command1 Command2 ... CommandN Done When the value of

Shell scripts define variables and reassign _linux shell

The shell supports custom variables. Defining variables When you define a variable, the variable name is not a dollar sign ($), such as: Copy Code code as follows: Variablename= "Value" Note that there can be no space

Shell scripts convert files from GBK to UTF-8 encoded _linux shell

Shell script: #!/bin/sh # # # Convert file from GB2312 to UTF-8 # path= "$" unset opt if ["$" = "Force"]; Then opt= "-c-s" fi if [-Z "$path"]; Then echo "Nusage: $ n" elif [!-e "$path"]; Then echo "Nerror:destination: $path does not exist.n"

Sharing of shell scripts for Linux system security (applicable CentOS) _linux shell

We will use the common system security configuration as a shell script, only to run this shell script on the server to complete the security settings. Linux system security Settings Shell script is the second update, has been heavily used in a

Circular statements in the shell for, while, until instances explain the _linux shell

In a programming language, a looping statement is one of the most basic syntaxes, and is no exception in the shell (here is bash).This includes the For/while/until loop, as well as the syntax instance of the variable increment. The loop statements

Shell scripting to fix bash vulnerabilities share _javascript tips

Search on the Internet to find a great God wrote Shell Repair Bash Vulnerability script, feel very good, dragged to my blog to share to everyone. Script content: Copy Code code as follows: #/bin/bash #Author Alex Fang. Updates may

Shell Basic Learning Series II: Variables

The shell supports custom variables.Defining variablesWhen defining a variable, the variable name does not have a dollar sign ($), such as: VariableName="value" Note that there can be no spaces between the variable name and the equals

Linux-shell First Lesson

Linux-shell First Lesson1, through a small example to introduce the shell#! /bin/sh Call Sehllecho Print content read input cd jump directory pwd View current directory650) this.width=650; "title=" 1.jpg "src=" https://s5.51cto.com/wyfs02/M00/8D/EA/

Shell Programming Basics-sendmail

Installation of the Linux SendEmail tool 1. Download the file #wget http://files.cnblogs.com/files/sunziying/sendEmail-v1.56.tar.gz2. Installing #yum Install SENDEMAIL3, main parameters:-F is the From, the sender address-t means to, the recipient

Operator of Shell programming

1. Weaknesses of Shell variables: weak type and default string type2. Declare command2.1 Declare declaring variable type declare [+/-] [option] Variable name    2.1.1 Declares a numeric type variable: declare-i c= $a + $b # A and B are not declared

Use shell scripts on Linux to view memory conditions (super-practical)

#!/bin/bashExport Chknum=1#shell搅拌存放目录 (The output log file is also stored in the directory after it is executed)Echo 3 >/wls/wls81/shellSyncWhile [$chknum-ge 0]Doecho "-------------------------------------------------------" >> Trace.logmt= ' Free |

Shell Experience Three

Testing and comparison of shell scriptsTest command: Checks the file type and compares the value (depending on the execution result of the expression (true or false), returns an exit status. )NAMETest-check file types and compare

CentOS 61-Key System optimized Shell script

CentOS 61-Key System optimized Shell scriptThe contents of the script are as follows:#!/bin/bash#author Suzezhi#this script is only for CentOS 6#check the OSPlatform= ' Uname-i 'if [$platform! = "x86_64"];thenecho "This script was only for 64bit

Total Pages: 541 1 .... 357 358 359 360 361 .... 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.