1. $ # number of parameters passed to the script2. $ * display all parameter variables passed to the script with a single string. Different from location variables, this option can have more than 9 Parameters3. $ ID of the current process running
The common code for linux shell to read files cyclically by line is as follows:
#/Bin/bash printf "********************************* * *** \ n "echo" cat file whiel read line "cat test.txt | while read line do echo $ line; done printf "***********
A simple command
Command [-option] [parameter]
Command can be an alias, function name, built-in command, external executable program or script
Compound Statement of two shell Control Structure
ForName[InWord]; DoList; Done
For ((Expr1;Expr2;Expr3);
Michael Stutz, author of The Linux Cookbook, has summed up 10 good habits based on his years of UNIX experience. I personally think it is really useful. The following is a summary of this article.1. Create a hierarchical Directory: Use the-p option
Arrays, as a special data structure, have a place in any programming language. Of course, bashshell is no exception. This article makes a small summary of the shell array.Here we will only discuss the situation of one-dimensional arrays, with regard
#! /Bin/bash NAME = java NOP =/bin/trueDATE = $ (/bin/date + "% Y-% m-% d % H: % M: % S ") ps-ef | awk-F "" '{print $8, $2}' | grep ^ java>/dev/null 2> & 1 case "$? "In0) # It is running in this case so we do nothing. echo "$ NAME is running OK.
Practical features of awk:Like sed, awk also scans files row by row. From the first row to the last row, it searches for the rows matching the specific template and runs the "select" action on these rows. If no action is specified for a template,
In Linux, there are many methods to read a file row by row. The most common method is the method in the script below, which is the most efficient and the most commonly used method. To give you an intuitive feeling, We will test the execution
Recently, scripts always need to be computed. It will be troublesome to use awk each time. It encapsulates the addition, subtraction, multiplication, division, and source math. sh for each call.
Some key points should be pointed out to avoid
As system O & M personnel, it is necessary to monitor important system parameters in real time, such as zombie processes, CPU utilization, memory usage, disk space usage, and system load balancing, based on the latest information, we can determine
Task
Find the file names of all png files in the folder, and copy xxx.html as the file name. html
Replace xxx in xxx.html with the file name.
Ls | grep. png | sed's/\. png \ * // '|./cp. sh
Cp. sh
While read ip
Do
Sed's/xxx/'"$ ip"'/G'
Centos system password cracking
GRUB: On the boot loader menu, type [e] to enter the editing mode. You will face a list of pilot projects. Find the line with the output similar to the following: kernel/vmlinuz-2.4.18-0.4 ro root =/dev/hda2 press the
When Centos is installed without a specified partition by default, the logical volume does not have an independent/tmp, which may cause security risks./dev/shm is also one of the risks.
# Dd A 1 GB file, file/. tmpfs
Ddif =/dev/zeroof =/. tmpfsbs
Taking a 10-bit pure letter password as an example, many people may think that hackers will run a calculator, and then each digit counts from a to z to get the correct combination, but this is undoubtedly the most stupid method, and the effect is
Many people are learning about the Linux operating system. When we use the Linux operating system to access the Internet, we may encounter hacker attacks. This article describes some practical techniques for preventing hackers in the Linux operating
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