Shell Overview:The interpreter program between the Linux kernel and the userUsually refers to/bin/bashResponsible for directing to the kernel to translate and communicate user/program instructionsEquivalent to the "shell" of the operating systemHow
If we define a variable as:File=/dir1/dir2/dir3/my.file.txtCan be replaced with ${} to get different values:${file#*/}: Delete the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Remove the last/and left string: my.file.txt${file#*.} :
Tips for ShellThere'll is some case-based tips for Shell.1. Replace The sequence space with newlineInput Examplea b c dOutput ExampleabcdSummarysedis the best solution.Solutionsed -r -e ‘s/[[:space:]]/\n/g‘2. Sort the unordered word list (with
1. Time CalculationStarttime= 'Date+'%y-%m-%d%h:%m:%s''; Endtime=`Date+'%y-%m-%d%h:%m:%s''; Start_seconds=$(Date--Date="$starttime"+%s); End_seconds=$(Date--Date="$endtime"+%s);EchoEnd_seconds-start_seconds2. Get the status code returned by the
Shell Script whitespace specificationPractice, write a script:Pass a user name parameter to the script to determine if the user's user name matches the group name of their base group, and displays the results#!/bin/bash#if! ID $ &>/dev/null;thenecho
Environment Variables Section:1. View Global variables: printenv/env2. Displays the value of a single environment variable: Echo as Echo $HOME3. Display all environment variables set for a particular process: set4. Setting global variables: Creating
[ -a FILE ]
FILEtrue if it exists.
[ -b FILE ]
True if it FILE exists and is a block special file.
[ -c FILE ]
FILEtrue if a special file is present and is a word.
[ -d FILE ]
True if it
Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtDifferent values can be replaced with ${}, respectively:${file#*/}: Remove the first one/And the string to its left:Dir1/dir2/dir3/my.file.txt${file##*/}: Erase the last one/And the
All kinds of monitoring scripts, memory, disk, port, URL monitoring alarm
How to monitor whether the site directory has been tampered with and how the site directory is recovered after batch tampering
How to develop various services
Command history# Cat/root/.bash_history//place where historical commands are stored# History//View the number of command histories# echo $HISTSIZE//View the number of bars that can be saved# Vim/etc/profile//Change the value of variable histsize
Grammar:awk ' {command} ' filename multiple commands are separated by semicolons .awk ' begin {Command1} {Command2} End{command3} ' Note: Begin, END needs to be capitalizedCommon Variable Description:FS: Specifies the delimiter, which is the default
In the course of learning Linux, you may have been exposed to a special symbol, such as "*", which is a wildcard symbol that represents 0 or more characters or numbers. The following Amin the special characters that are commonly used.* represents 0
1, list_sys_status.shDisplays the following information used by the system:Host name, IP address, subnet mask, gateway, DNS server IP address information#!/bin/baship= ' Ifconfig eth0 | head-2 | Tail-1 | awk ' {print $} ' | Awk-f ":" ' {print $} 'zw=
---------Transferred from http://www.runoob.com/linux/linux-shell-array.html----------Copyright belongs to the original! Shell some powerful commandsShare some shell usages and scripts that you may not know about, simple & powerful!Before reading
Test command, Loop statementTest command format:Test conditionUsually, in the If-then-else statement, [] instead, that is, [condition]. Note that there are spaces on both sides of the square brackets.Common commands:-a two conditions at the same
First, what is the bean Shell
BeanShell is a scripting language that conforms fully to the Java syntax specification and has its own syntax and methods.
BeanShell is a loosely typed scripting language (this is similar to JS);
Background: Documenting the process of deploying a JAR program in a Linux environment1 Deployment Process record 1.1 program structureThe main function here is in the Demrest2.java file.For ease of deployment, do the following two points:1 A
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.