The find command in shell programming

The full syntax format for the Find command is as follows:find [path] [options] [tests] [actions] PathThe path section is easy to understand: You can use either an absolute path, such as/bin, or a relative path, such as. 。 You can also specify

Some conditions of the shell judge

1. Shell to determine the file, whether the directory exists or has permissions2. #!/bin/sh3.4. Mypath= "/var/log/httpd/"5. myfile= "/var/log/httpd/access.log"6.7. # the-x parameter here determines whether the $mypath exists and has executable

Regular expressions in the Shell

Often in contact with the Shell scripting language, you will often see a shell command followed by a bunch of messy option, similar to the sed-e "s/^[^\-]*-//" , although know that it must be a logical combination of conditions, but if not familiar

Process Execution Shell Script

Overview:The process class is an abstract class (all methods are abstract) and encapsulates a process (that is, an executing program).The process class provides a way to perform input from the process, perform output to the process, wait for the

Shell Remote Copy Script

#!/bin/bashtext= ' host_list ' line= ' awk ' 1 ' host_list|wc-l ' for ((i=1;iCat Host_list192.168.209.133 Root 123456This article is from the "Eight Miles" blog, so be sure to keep this source http://5921271.blog.51cto.com/5911271/1582833Shell

Common shell Command collation

1. View memory from large to small arrangementPS-E-O "%c:%p:%z:%a" |sort-k5-nrAnalysis:-E Display Process-O display by user-defined format%c CPU%p Parent Process ID%z Virtual Memory%aSort Order Command-k5 sorted by 5th column-nr comparing numbers

Use of sed in the shell

1. In the command Line Definition Editor commandcommand format sed options script fileSED does not modify the text file's data, he only sends the modified data to stdout.2. Use multiple editor commands on the command linePlace the command in a

The DNS installation configuration for shell scripts

conf= "/var/named/chroot/etc/named.conf"Datadir= "/var/named/chroot/var/named"Rpm-q bind &>/dev/nullIf [$?-ne 0];thenYum-y Install bind Bind-chroot caching*echo "Options {Directory \ "/var/named\";};"> $confFiRead-p "Please input domain:" domaingrep

Shell-find Error parsing

Previously wrote an article, with Shell timed purge expired files "Shell timed purge expired files", its practical is simple find commandAfter the colleague adopted, he debug the script, there are a few errors, I did the collation:1.find:paths must

Shell Date Command Collation

Recently found that the date command is especially useful (not in Mac)1. Get today's date[Email protected] ~]# date +%y%m%d201411232. Get the date of a day" 2014-11-12 " +%y%m%D20141112This seems like crap, but it's okay, keep looking.3. Get a day

Two small shell scripts

Prevent other people from brute force password and deny this IP access to SSH service if someone tries to enter a password error number 5 times.#!/bin/bashlastb | awk  ' {print $3} '  | uniq -c | sort -r  > a.txtsed -ri  ' [email protected]^[[:space:

Shell script: Print 99 multiplication table

Today in three different ways to achieve the shell script Print 99 multiplication table, the code is as follows Method 1: Use a For loop (a.sh) #!/bin/shfor i in {1,2,3,4,5,6,7,8,9}do to J in {1,2,3,4,5,6,7,8,9} do ((product= $i * $j)) Echo-ne $i \ *

Linux Shell Learning

1.Shell itself is a program written in C language, it is a bridge for users to use Unix/linux, most of the user's work is done through the shell. the shell is both a command language and a programming language. as a command language, it interprets

"Shell" crontab command

I. Introduction of CrondCrond is a daemon that is used to periodically perform certain tasks or wait for certain events under Linux, similar to Scheduled tasks under Windows, when the operating system is installed, the Service tool is installed by

Shell syntax and tips-Continuous updates

1. String Qiatouquwei #,%For example:X=aabbaarealwwvvwwecho "${x%w*w}"Aabbaarealwwvvecho "${x%%w*w}"Aabbaarealecho "${x# #a *a}"Lwwvvwwecho "${x#a*a}"BbaarealwwvvwwWhere, # means pinch the head, because on the keyboard # on the left.Where,% is said

Algorithm----Hill sort (shell sort)

When analyzing the process of inserting sorting algorithm performance, it is known that when the array is small or there are more ordered subsequence, the insertion sort will finish sorting the array in a very short time, so you can design a

Linux shell programming Simple shell and Windows file Mutual transformation

What is a shell?LS there a bunch of directories? What is the implementation process? LS is an application, the shell translates it into 01 code to the kernel, the kernel to the hardware, and then back!The shell is also a powerful programming

Summary of the use of shell scripts and the use of shell scripts

Summary of the use of shell scripts and the use of shell scripts (1) The csh script can call the bash script, and vice versa. (2). How to call variables and functions defined in other scripts. (3). Defined variables. The default value is global

Shell-find error Parsing

Shell-find error Parsing I have written an article about how to use shell to regularly clear expired files. In fact, the simple find command is used. After my colleague adopted the script, he encountered several errors when debugging the script. I

Linux uses shell scripts for the key Nohup and shellnohup tasks

Linux uses shell scripts for the key Nohup and shellnohup tasks There are many articles on the Internet to teach you how to use scheduled tasks, so I will not talk much about other nonsense. I have SH for timing, but you don't know it. You must use

Total Pages: 541 1 .... 432 433 434 435 436 .... 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.