The folder does not exist and is createdif [!-d "/data/"];thenmkdir/dataelseecho "folder already exists" fiFile exists then deleteif [!-F "/data/filename"];thenecho "file does not exist" Elserm-rf/data/filenamefiDetermine if a folder existsIf [-d
I. BACKGROUNDLinux logs a large number of events to disk, most of which are stored in plain text in the/var/log directory. Most log entries are syslogd through the System log daemon and are written to the system log. Ubuntu includes methods for
We introduced the Zabbix installation configuration steps and simple actions, triggers, modules and other functions in the previous blog, we are here to introduce the following Zabbix automatic discovery, automatic registration, web monitoring,
if [$#! = 1]; Thenecho "USAGE: $ tabname"echo "e.g.: $ cdr_call_20040701"Exit 1;FiLocation parameters $ #代表了命令行的参数数量, $ $,..., $N, and $ A represents the name of the script-ne Not equal to-----------------------Used in shell programming to determine
If usage:if []; thenCommandelif []; thenCommandElseCommandFiIf parameter:Used in shell programming to determine parameters within an if statement–b return True when file exists and is a block file-C Returns True when file exists and is a character-D
Source: loggly Translation Source: LCTT Welcome to share the original to Bole headlinesThe main reason people create logs is the wrong line. Usually you will diagnose what problems occur in your Linux system or application. An error message or a
RSYSLOG is an efficient logging system and is the default journaling system currently used by Ubuntu and CentOS.Loganalyzer is a PHP-written Web front-end that you can use to analyze and view the logs generated by RSYSLOG.After research, I am
If you're used to working on a Linux system, you'll find that there are a lot of text files in the Linux world. Configuration files and log files are usually in text format. These files usually have very long content and cannot be displayed in a
One of the keys to successful management of any system is to know what is happening in the system. Exception logs are provided in Linux and the log details are configurable. Linux logs are stored in plain text, so you can search and read them
I am not actually SA. Many Ubuntu commands cannot be remembered in many cases. So we can find a place to record it. Long-term update. You may have to deal with ubuntu in the next three months. This document may be updated for a long time. 1: How to
If statement test condition. After the test condition returns true (0) or false (1), you can execute a series of statements accordingly. If statement structure is very useful for error checks. The format is:If condition 1Then command 1Elif condition
Operator
Description
Example
File comparison operator
-EFilename
IfFilenameYes, true
[-E/var/log/syslog]
-DFilename
IfFilenameIs a directory, it is true
[-D/tmp/mydir]
-FFilename
IfFilenameIs
1 shell $! , $ ?, $, $ @
• $ N $1 the first parameter, $2 the second...• $ # The number of command-line parameters.• $0 the name of current program.• $? Last Command or function's return value.• $ The program's PID.• $! Last program's PID.• $ @
File comparison operator, comparison operator
File comparison operator-E filename if filename exists, it is true [-e/var/log/syslog]-D filename if filename is a directory, it is true [-d/tmp/mydir]-F filename if filename is a regular file, it is
In linux shell if parameter shell programming, the if statement is used to determine the parameter www.2cto.com-B. When the file exists and is a block file, true-c is returned when the file exists and is a character file. -d. When pathname exists
Update History
April 25, 2014-draft written
Introduction
After the automated deployment of AutoYast and automated monitoring of BMC Patrol have taken shape, log collection, management, and analysis have become a problem we need to consider. Combined
Use logs in Linux to troubleshootThe main cause of log creation is troubleshooting. Usually you will diagnose why the problem occurs in your Linux system or application. Error messages or a series of events can provide you with clues to identify the
BKJIA special draft]1. Introduction to important log files in Linux
/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
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.