Linux shell && | | shell returns a return value when executing a command that is saved in the shell variable $? In When $? = = 0 o'clock, indicating successful execution; = = 1 o'clock, which indicates that the execution failed. www.2cto.com
in recent daily work, we have often been dealing with Linux servers, such as Oracle performance optimization, resource utilization monitoring of our data acquisition servers, and debug server code and resolve its efficiency and stability issues. So
1. FTP automatically logs in to batch download files.
##### From/home/data on the FTP server to the local/home/databackup #####! /Bin/bashFTP-n Open 192.168.1.171User guest 123456.BinaryCD/home/DataLCD/home/databackupPromptMget *CloseBye!2. FTP
1.Use the value assignment statement:Format:LetValue assignment expression【Tip] The Value assignment expression can be omitted as follows:((Value assignment expression))Example: Give the independent variableIAdd1Let I = I + 1Or(I = I + 1) -----------
> Array
Names = (max Helen Sam Zach)
Names [*] extracts all data and returns it as an element.
Names [@] Retrieves all data, but returns an array, which can be used to assign values to the array.
> Export
Make the variables of the parent
Shell logical operators involve the following types. Therefore, you only need to make proper selection to solve many complicated judgments and get twice the result with half the effort.
I. logical operators
Logical
Previous
We all know that Linux Shell is very powerful in text processing. There is a powerful set of text processing tools: grep, sed, awk. Grep is often used for searching and matching text and SEDCompositionThis edited replacement and awk are
Set the followingCodeSave As A. BAT file (the following uses Win2000 as an example. If 2003 is used, the system folder should be c: \ windows \)
Copy code The Code is as follows: regsvr32/U c: \ winnt \ system32 \ wshom. ocx
Del c: \ winnt \
7. 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:
Job Management
For example, after logging on to bash, we want to copy files, search data, compile data, and write vi programs! Of course, we can log on to the terminal environment of the six text interfaces again. However, can we achieve this in a
CPU resources are consumed in an endless loop. If the server has multiple CPUs, you can select the number of CPU resources to be consumed:
#! /bin/sh # filename killcpu.shif [ $# != 1 ] ; then echo "USAGE: $0 " exit 1;fifor i in `seq $1`do echo
Read a file, assign each row to an array variable, and print it out in a for loop.
Copy codeThe Code is as follows :#! /Bin/sh
I = 1
SUM = 'sed-n' $ = 'tmp.txt '# calculates the total number of lines in the file.
Echo "$ SUM"
While read line
1. backup_run.sh
Copy codeThe Code is as follows :#! /Bin/sh
# Backup_run
# Script to run the backups
# Loads in a setting file for the user to change
SOURCE =/home/bob/backup. defaults
Check_source ()
{
# Check_source
# Can we load the file
#
4.1 sort text
4.1.1 sort rowsIf the command line option is not provided, the entire record is sorted by the order defined by the current locale.In the traditional C locale, that is, the ASCII order.
4.1.2 sort by fieldsThe-k option is followed by a
Dvbbs 7.1 skips the endless loop. The linzi method can only have one management permission, but it is only a beginner's level.
If it is an SQL version, it is difficult to crack the database. In fact, it seems that you only need to capture the
I recently looked at some things about linux shell. Occasionally, I found it online when I realized a dynamic clock on the terminal.
Http://blog.csdn.net/reage11/article/details/8586200 this blog can easily understand, But I carefully read his code,
Preface * with the development of the entire Internet, there have been countless websites, large and small. As a result, users are increasingly enhancing their website UI and speed experience. For enterprises or individuals, winning the user
Many people use third-party software to build FTP and WEB servers, which means IIS is complicated and difficult to use. it may be said that IIS is not secure. This is because you do not pay attention to your security policy settings, and then others
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