Documenting the shell activity has many benefits, such as the need to monitor user behavior, backtracking before the system crashes. The key tool to implement this function is quite simple, it is COM interface ishellexecutehook. After writing a COM
This article mainly introduces the shell script to empty more than 1G log files, this article directly gives the implementation code, the need for friends can refer to the following
A question about how to automatically delete a specified file
This article describes the most commonly used tools for using shell to process text under Linux:Find, grep, Xargs, Sort, uniq, tr, cut, paste, WC, sed, awk;The examples and parameters provided are the most common and practical;The principle I use
Test Condition Expression Description
File symbols:
[Root@lamp test]# Help testtest:test [expr]Evaluate conditional expression.Exits with a status of 0 (True) or 1 (false) depending onThe evaluation of EXPR. Expressions May is unary or binary.
The shell may often see: >/dev/null 2>&1
Eg:sudo kill-9 ' ps-elf |grep-v grep|grep $1|awk ' {print $} ' 1>/dev/null 2>/dev/null
The result of the command can be defined as the output in the form of%>
/dev/null represents empty device files
>
A signal is a interprocess communication mechanism that provides an application with an asynchronous software interrupt that gives the application the opportunity to accept commands (i.e., signals) sent by other programs live terminals. After the
Locate allows users to quickly search the file system for specific files. The approach is to create a database that includes all the file names and paths in the system, and then simply query the database when looking, without actually going into the
In a Linux system, when you enter a command, and then press two times the TAB key, all available commands that begin with the characters you enter are listed. It's not new, maybe you already know. This feature is called the command line complement
Formal representations (or regular representations) are arranged by special characters to search for/replace/delete one or more columns of text strings, and, simply put, formal notation is an "expression" used above the processing of strings. Formal
Remove software
To remove the software is very simple, just execute the following command:
Copy Code code as follows:
# rpm–e Xanim
At this point, the user should be careful to use the name of the software Xanim, rather
Shell string comparisons, judging whether it's a number
Binary comparison operators, comparing variables or comparing numbers. Notice the difference between the number and the string.
Integer Comparisons
-eq equals, such as: if ["$a"-eq
Let's start a new year with these unix/linux command techniques to improve productivity at the end. I've been looking for it for a long time and I'm going to share it with you now.
>/path/to/file.log
# or use the following format
:
Shell Script of Linux Basics
1 Shell sciptA program written in the instruction and basic program design structure to complete a complex process
1.1 Program Writing
Copy Code code as follows:
#!/bin/bash
# program:
# This
Linux system is a multi-user multi-task operating system, any one to use system resources, users must first to the system administrator to apply for an account, and then the identity of the account into the system. The user's account can help the
It took 1 days to write a script to detect whether an IP network is unblocked, but to detect whether the network is unblocked is easy to implement, but it is not good to add some restrictions.
Copy Code code as follows:
#!/bin/bash
######
Let's get to the point. The company now has 2 servers, are CentOS systems, a local (LAN), a computer in the telecommunications room. Because the work needs, the daily backup room data to the local, has been FTP login, and then downloaded to the
First, CPU information collection
1). Collect CPU Usage rate
Acquisition algorithm: collecting and calculating CPU total utilization or single kernel utilization through/proc/stat file. Taking cpu0 as an example, the algorithm is as follows:1. Cat/
Title: Write a shell script that uses ping to determine whether the host in the specified IP or IP side is alive.
Accept only the specified IP format input and IP segment input (for example: 192.168.2.88 or 192.168.2.) Note that there is a point
It is a stupid thing to pipe the content of a wget or curl output to bash or sh, such as the following:
[Plain] View plain copy on the code to see a piece of coding derived to my Code slice
Wget-o-http://example.com/install.sh | sudo sh
Command
I/O redirect Detailed and application example
1, the basic concept (this is to understand the knowledge behind the premise, please be sure to understand)
A, I/O redirection is usually related to FD, Shell FD is usually 10, namely 0~9;
b, commonly
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