Bash Shell comments several ways to _linux shell

1, the simplest way Copy Code code as follows: : .... Comment Content Block The input is redefined to the previous command, but: it is an empty command, so it is equivalent to a comment.If a command with an inverted

Implement string reversal method in shell share _linux shell

In the process of doing keyword cleaning, you need to filter out a class of words that do not conform to the end of a word, the idea is to put this batch of words according to the last word sort, so think of the first of these words to reverse, such

Shell script Implementation Batch collection Love station keyword library _linux shell

Shell Batch collection Love Station keyword library, the whim of the play, not perfect, first put out, later slowly update, although the function is simple, similar tools are also many ready-made, but after all, it is their own writing tools,

4 ways for Shell to remove empty rows _linux shell

Sometimes when we process and view files, there are often a lot of empty lines, in order to be beautiful or need, it is necessary to remove these lines, the following methods: 1) with the TR command Copy Code code as follows: Cat

Functions, function definitions, scope issues in the shell _linux shell

Speaking of function calls, I believe that we will not be unfamiliar, however, for beginners shell of me, the shell function call Way is a little let me not too accustomed to, I have gone a lot of detours, because the transfer parameters when a very

25 Useful shell Scripts Common command sharing _linux shell

ssh

1. List all directory usage and sort by size. Copy Code code as follows: Ls|xargs Du-h|sort-rn #不递归下级目录使用du-sh 2. View the file exclusion with the # switch and blank line, suitable for viewing the configuration file. Copy

Nginx Log Cutting shell script _linux shell

First, the script idea The first step is to rename the log file without having to worry about renaming the log file and losing the log when Nginx is not found. Before you reopen the log file for the original name, Nginx still writes to the file you

Implementation of bulk Linux formatted hard disk and mounted hard disk script sharing _linux shell

Copy Code code as follows: #!/bin/bash Path=/bin:/sbin:/usr/bin:/usr/sbin Export PATH I=1 While [$i-lt] #硬盘数量, 12 blocks apart from the system disk Todo J= ' echo $i |awk ' {printf '%c ', 97+ $i} ' #系统盘是sda, if the other needs to modify

Shell script realizes SSH automatic login function sharing _linux shell

ssh

FileName: Ssh_auto_login Copy Code code as follows: #!/usr/bin/expect ## # SSH Analog Lander # # @author Zhiyuan ## If {$ARGC Puts "Error params: $argv" Puts "Expect params:user passwd IP port [translate_id]" Exit 1 } Set

Real-time view of system traffic shell script sharing _linux Shell

Copy Code code as follows: #!/bin/bash While ["1"] Todo Eth=$1 rxpre=$ (Cat/proc/net/dev | grep $eth | tr: "" | awk ' {print $} ') txpre=$ (Cat/proc/net/dev | grep $eth | tr: "" | awk ' {print $} ') Sleep 1 rxnext=$ (Cat/proc/net/dev |

Shell script counts the number of directories and files in the current directory _linux shell

Linux how to count the current directory under the number of files, and how many directories? Write a script with the shell below, put it in the current directory, and execute it. Copy Code code as follows: #!/bin/bash #脚本名称

Nested execution expect command instance _linux shell in shell

Always want to write expect action in the Bash script, so I do not have to write two scripts to execute, and made a little achievement in the afternoon finally, to show you. System: CentOS 5.x 1. Install expect first Copy Code code as

Shell script to determine if the Apache process exists _linux shell

Write a script to check whether the Apache process exists, if it does not exist, the display does not exist, if it exists, display the number of processes, when not equal to 10, notify the administrator in red font, and ask the administrator whether

Command line A new method of adding an account number (Shell.users) _dos/bat

But add the user, this one shell.users is enough. This may also be a new method of adding a user, possibly with the deletion of Net.exe and no ADSI. The code is as follows: Js: Copy Code code as follows: var o=new activexobject

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 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.

Scripting code for sensitive users in Linux systems _linux Shell

A sensitive user here means that the user belongs to more than one group, or that the user belongs to a group name that is not the same as the user name. #! /bin/bash #list user who belong than one group #and list user who belong to the

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 script implementation of memcached process monitoring _linux shell

The Web server uses memcached, but does not know why memcached always hangs (basic 20 minutes ~ 50 minutes), causes some website page to visit the time error; When you define the log, you cannot see what ; Preliminary determination is related to the

Total Pages: 541 1 .... 413 414 415 416 417 .... 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.