From: http:// OS .51cto.com/art/200912/165925_1.htm
Location Parameter $1, $2 ,..., $ N, $ # represents the number of parameters in the command line, $0 represents the Script Name, the first parameter represents $1, the second parameter represents $2
Use the if statement to determine parameters in shell programming
-B. returns true if the file exists and is a block file.
-C: returns true if the file exists and is a character file.
-D. If pathname exists and is a directory, true is returned.
-E:
Let's take a look at the simple technique for processing command line independent variables, and then look at the basic programming structure of bash.
Receive independent variable
In the sample program in the introductory article, we use the
[-A file] true if the file exists. [-B file] If the file exists and is a special block file, it is true. [-C file] If the file exists and is a special word file, it is true. [-D file] If the file exists and is a directory, it is true. [-E file] If
BASH Shell script learning Summary. It is easy to determine whether a log file is larger than 2 GB. If it is larger than 2 GB, delete it. I haven't written bash for a long time, so I can't even think of it. So I reviewed it and made a summary of
Use logs in Linux to troubleshoot errors.
Source: logugly Source: LCTT welcome to share the original article with bole headlines
The main cause of log creation is troubleshooting. Usually you will diagnose why the problem occurs in your Linux system
Mysql High Availability LVS + KEEPALIVE + MYSQL, lvskeepalive1. Architecture Diagram
Note:
(1) Mysql needs to remove the bind-address Configuration; otherwise, virtual ip access cannot be implemented.
(2) Disable all linux
Getting started with Linux: Common log files in Linux
Logs are very important to System Security. They record all kinds of events that occur in the system every day. You can use them to check the causes of errors, or look for traces left by
View watch commands in CentOSLinuxWatchCommand-to process duplicate tasks
LinuxInWatchCommand provides a way to process repeated tasks. DefaultWatchThe command is repeatedly executed every 2 seconds. Watch is a good tool for observing log files. The
Use the if statement to determine parameters in shell programming
-B. returns true if the file exists and is a block file.
-C: returns true if the file exists and is a character file.
-D. If pathname exists and is a directory, true is returned.
-E:
10 useful tools for Linux UsersIntroduction
In this tutorial, I have collected 10 useful tools for Linux users, including various network monitoring, system auditing, and some other practical commands, it can help users improve work efficiency. I
/Var/log/boot. Log
This file records the system events during the boot process, that is, the information displayed during the Linux system boot self-check process, as shown in 1:
/Var/log/cron
This log file records the actions of sub-processes
To learn about the driver, I found an instance helloworld and wrote my first driver.
1. Establish the environment
Install the Ubuntu system, open the terminal, and enter with the root permission. The command is as follows:
bory@borya:~$ sudo
file Testing (-f,-d,-r,-r,...)
[-f/root/file.txt],[-d/root/mydir]
[[-f/root/file.txt]]File testing aspects [[]] same as []
string comparison (-z,-n,!=,==,...)
[-Z "${str}"],["${str}"! = "${str}"],[!-n "${str}"][] can only be
Logs are very important to the security of the system, and it records the various things that happen on a daily basis, which can be used by the user to check the cause of the error, or to find traces of the attackers left behind by the attack. The
Linux shell directives such as-D,-F,-e are judged by :File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file
Beginner Linux may appear to forget the command, this time should be a few common commands to write down, so that every day can knock, the days will be a long time in the mind has a deep impression. Here is my record of the common Linux commands, as
File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic link
Operator
Describe
Example
File comparison Operators
-e filename
True if filename exists
[-e/var/log/syslog]
-D filename
True if filename is a directory
[-d/tmp/mydir]
A Linux basic commands1.1. CP commandThe function of this command is to copy the given file or directory to another file or directory, which is very powerful.Syntax: CP [option] source file or directory destination file or directory1.2. MV
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.