Basic working principle of Shell
The most important system program provided by Linux is the Shell command language interpreter. It does not belong to the kernel, but runs in user mode outside the core. Its basic function is to explain and execute
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);
Checks system hardware information of online servers, including IP addresses (intranet, all), IP addresses of remote control cards, cpu information (cores), memory, hard disks, machine codes, manufacturers, and product names.#! /Bin/sh# Checking
Grep family: 1. grep exit status:0: indicates successful;1: The matching pattern cannot be found in the provided file;2: The file provided in the parameter does not exist.See the following example: /> Grep 'root'/etc/passwdRoot: x: 0: 0:
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,
The break command can contain one parameter. A break loop without a parameter can only exit the innermost loop, while break N can exit the N-layer loop.The continue command can also contain a parameter. A continue command without a parameter only
1. display the 10 processes that consume the most memory/CPUPs aux | sort-nk + 4 | tailPs aux | sort-nk + 3 | tail------------------------------------------2. view the number of concurrent Apache requests and their TCP connection statusNetstat-n |
Sometimes you need to process some txt files generated in windows under linux, but garbled characters often occur when you view them on the console, because the character sets used by the two operating systems are different by default, in Linux, the
Method 1 (gzexe ):This encryption method is not very safe, but can meet the general encryption purpose, can conceal the password and other information in the script.It uses the built-in gzexe program, which not only encrypts but also compresses
Nux redirection refers to modifying some of the original default items and changing the default Execution Mode of the original system commands, for example, I don't want to see the output on the monitor. Instead, I want to output the output to a
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
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'
The group hired top security vendors in China to scan the security of enterprise information systems and found that the author's O & M system has the SQL injection vulnerability, database Elevation of Privilege Security Vulnerability, password
Check whether the remote port is open to bash:
echo >/dev/tcp/8.8.8.8/53 && echo "open"
Transfer the process to the background:
Ctrl + z
Switch the process to the foreground:
fg
Generate a random hexadecimal number, where n is the number of
Firewalls can be divided into several different security levels. In Linux, because there are many different firewall software options, the security can be low and high, and the most complex software can provide almost no penetration protection
PHP security configuration in Linux is a complex process, which involves many detailed settings. A script is sent here, this script is used to check whether your PHP environment has security risks and reinforce your PHP environment.Function:
1.
After purchasing a server (currently the mainstream configurations are dual-core and quad-core), the system will be installed in the next step. We recommend that you use 64-bit Centos5.5 here. When installing the system, we should minimize the
Whether you are an ordinary Linux Desktop user or a system administrator managing multiple servers, you are faced with the same problem: an increasing number of threats. Linux is an open system that allows you to find many ready-made programs and
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