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
1. Linux script compiling Basics1.1 Basic syntax IntroductionStart with 1.1.1The program must start with the following line (the first line of the file must be placed ):#! /Bin/shSymbol #! The parameter used to tell the system that the program is
Compile as script
The basic form of this script is from the rsync website. In fact, there is only one command:
Rsync-force-ignore-errors-delete-excluded-exclude-from = exclude_file-backup-dir = 'date + % Y-% m-% d'-av
Key parameters are:
-Backup:
There are two ways to assign values to an array variable:
(1) name = (value1... valuen) The subscript starts from 0.
(2) name [index] = value
Arrays are a form of organizing several variables of the same type in order to facilitate processing in
Data storage (assuming the key is test and the value is 12345)
Printf "settest005 \ r \ n12345 \ r \ n" | nc127.0.0.112000
STORED
Data Retrieval (assuming the key is test)
Printf "gettest \ r \ n" | nc127.0.0.112000
VALUE test 0 5
12345
END
Increase
#! /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.
Linux shell get time and time interval (ms level)
Note: When performing some performance tests, we sometimes want to calculate the time when a program runs, sometimes you may write a shell script to control the performance test (such as running N
Shell commands related to the system running status:1. Linux real-time monitoring command (watch ):Watch is a very practical command that can help you monitor the running results of a command in real time, saving you the need to manually run it all
The lab background is in a LAN, where a host is designated as the management machine and other hosts as the managed machine. For convenience of future maintenance, the management machine must be directly logged on to the managed machine without a
The generated password and user input can be repeated.Therefore, it may be much more difficult to guess general rules.Current version rules:A -- number pair, location pairB -- after excluding the result of A, the number is correct, but the position
Components used to Query IP addresses
wget http://rfyiamcool.googlecode.com/files/nali-0.1.tar.gz
tar zxvf nali-0.1.tar.gz
cd nali-0.1
./configure && make && make install
The steps are similar to those of nginx, but the method for
There are a lot of spam on the network to scan the root account, so it is necessary to do a good job of security! The following are some security settings for reference only:1. Modify the SSH portVi/etc/ssh/sshd_configPort22
My operating system is centos6.4
Operating System: rhel 6.2 x86_64
Download and install the putty software package, I download the putty-0.62-1.el6.rf.x86_64.rpm
Http://rpm.pbone.net/index.php3:
1. Remote Host IP list file
[Root @ localhost ~] #
About partitions
If a potential hacker attempts to attack your Linux server, he will first try Buffer Overflow. In the past few years, buffer overflow is the most common form of security vulnerabilities. More seriously, the buffer overflow
Recently, in order to ensure security for the launch of the project, it is necessary to defend against DDOS and CC attacks and capital problems of the company. Now, O & M engineers are writing scripts for use, only simple defense
1. View IP
Because the root user has full operation permissions on the system, in order to avoid some mistakes, we recommend that you log on to the system as a general user. If necessary, you need root operation permissions, then, run the "su-" command to log
The sudo tool can help you allocate part of the system management responsibilities to others without having to grant full root access permissions. It is a setuid program. You only need to enter your own password to execute the command after sudo.Use
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.