Linux Shell Learning Notes fifth Day _ Other

Day Fifth: Functions and task scheduling Advantages of the function Divide and conquer F Work together Easy Management Easy Maintenance Structure of the function function functions name () { Command 1 Command 2 Command 3 } Parameter

Shell _linux The shell based on the date, month, and week of the Year code

Known three time variables:time1= "Fri Aug 23 11:35:21"Time2= "Mon Sep 2 16:18:09"Time3= "Tue Sep 3 16:06:33"Given that these three times can be determined to occur in 2011-2013, how quickly to determine what year it is? Want to output:time1= "2013/

A brief summary of the method of using Shell to judge string inclusion relationship _linux Shell

Objective Now every time you analyze the site log, you need to judge Baidu Spider is not the real spider, nslookup after the need to determine whether the results include "Baidu" string Here are some of the methods that are included in the

Each partition root directory releases Shell.exe,autorun.inf virus cleanup method _ virus killing

Virus Name: Trojan-psw.win32.magania.os Kabbah Worm.Win32.Delf.ysa Rising File changes: Releasing files C:\WINDOWS\system32\Shell.exe C:\WINDOWS\system32\Shell.pci C:\pass.dic Each partition root is released Shell.exe Autorun.inf Autorun.inf

Formatting long Lines A shell script that formats multiple lines of characters _linux shell

It hasn't been updated in a long time.Think you should continue reading the script. #14 Formatting Long Lines #!/bin/sh # A version of FMT, using Nroff. Adds Two useful flags:-W X for line width # and-h to enable hyphenation for

Methods for encrypting shell scripts _linux Shell

Using shell script to automate the maintenance of the system is simple, convenient and portable. But shell scripts are readable and writable, and are likely to reveal sensitive information, such as user name, password, path, IP, and so on.

Linux Shell if command parameter description _linux Shell

*-B Returns True when file exists and is a block file *-C Returns True when file exists and is a character file *-D returns True when pathname exists and is a directory *-E Returns True when pathname specified file or directory exists *-F returns

Common shortcut keys for Linux shell commands _linux shell

Ctrl + a switches to command line start Ctrl + e Switch to the end of the command line Ctrl + L Clear Screen contents Ctrl + U Clear the contents before the clipping cursor Ctrl + K-cut to clear the contents after the cursor Ctrl + y Copy the

Shell script code that counts CPU memory usage _linux shell

Copy Code code as follows: #!/bin/sh Clear while ((1>0)) Todo net=$ (NETSTAT-ANP | grep 1000 | grep EST | wc-l) prc=$ (ps aux | grep thread1 | grep-v grep | grep-v Screen | awk ' {print ' CPU: "$"%, MEM: "$"%, RSS: "$6/1024" M, VSZ: "$5/102

Shell finds three ways to find files larger than 1M in the current directory share the _linux shell

1, using Find parameters to achieve Copy Code code as follows: [Root@xiaobb mnt]# Find. -maxdepth 1-size +1000000c ./sys.tar.gz ./install.tar.bz2 ./ctex_2.9.0.152_full.exe ./php-5.3.6.tar.gz [Root@xiaobb mnt]# LS-LH Total 1.3G

Shell write alarm number control and recovery sample code _linux shell

I am also a novice, write a bit old-fashioned, right when practicing, for beginners friends reference it. Copy Code code as follows: #!/bin/bash If [$SUCC _ping-gt $ ((ping_count-1))];then If [F./alarm_file/alarm_$host];then

Linux Basics command daily accumulate _linux shell

Today, another Linux production environment to build. This is a lot of steps, very cumbersome and have to do things. Although many times, but there are many steps, orders do not remember, every time looking for information is troublesome, so take

The shell implements the text to be heavy and the original order _linux Shell

In simple terms, this technique corresponds to the following scenario Suppose there is text as follows Copy Code code as follows: Cccc Aaaa bbbb dddd bbbb Cccc Aaaa Now it needs to be processed, this is simple,

Automatic restart of service shell script code _linux Shell

Copy Code code as follows: #!/bin/bash if [!-f/tmp/down_count];then echo "0" > /tmp/down_count Fi Curl-i tomcat-host-o "/tmp/status" >/dev/null 2>1 Code= ' awk ' nr==1 {print $} '/tmp/status ' If ["$[code]"-ge];then

Linux uses rinetd to implement port forwarding _linux shell

Port forwarding under Windows is typically a self-contained NAT and Porttunnel, Portmap Linux Lower port forwarding mapping program called RINETD, boot method rinetd-c/etc/rinetd.conf, Pkill rinetd shutdown process Tools Home:

Comparison of 3 methods of shell script passing parameters _linux Shell

#!/bin/bash #extracting command text_text_text_line options as Parameters Help_info () {echo "NAME" echo "\t$0" Ech O "Synopsis" echo "\t$0 is a shell test about process Options" echo "DESCRIPTION" echo "\toption like-a-B param1- C param2-d "} If [$#

Shell script implementation recursively copies files from a folder _linux shell

Demand I wrote this script two days ago when I met the need to extract a file in a 10-story folder. A file structure like the following: Copy Code code as follows: Dir1 ├──a │├──b ││└──file1 │└──file2 ├──c │└──d │├──e

How shell scripts avoid repeated execution _linux shell

Many of the shell scripts executed with Cron may take a long time to execute for a variety of reasons, and it is necessary to check whether they are still running while running. This article provides a Linux shell script to check with the command sh

Shell Scripting Learning (iii)

Shell echo CommandDisplay Normal string:echo "I am cat_crazy."Note: The double quotes here can be omittedShow escape characters:If you want to output quotes, the * number needs to be escaped to output, as followsecho \ "I am cat_crazy\"The output is

Shell Text Processing

1. Document CollationWork number and name are recorded in the employee fileEmployee.txt:Jason SmithJohn DoeSanjay GuptaAshok SharmaRecord work number and salary in bonus fileBonus.txt:100 $5,000200300 $3,000400 $1,250Requires merging two files and

Total Pages: 541 1 .... 317 318 319 320 321 .... 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.