Back up your Web program#!/bin/bash/bin/tar czf/mnt/backup_website/web_$ (date +%y%m%d_%h%m%s). Gz. tar /mnt/wwwroot/web/mnt/backup_websitefind . -mtime +1"*20[1-9][3-9]*"xargsrm - 0Backing Up the
Alias:Alias ll= "Ls-l"Steps to find the command:
If you are using a relative command (such as./command directly executing the command file in the current directory), locate the file directly in the current directory and execute it.
Absolute
Different shells have different functions, the shell also determines the syntax of the function in the script, the default shell in Linux is/bin/bash, the popular shell has ash, bash, Ksh, CSH, zsh, and so on, different shells have their own
Special positional parameter variables in 1.shell$: Gets the file name of the currently executing shell script, including the script path if the execution script contains a path$n: Gets the nth parameter of the currently executing shell script, n=1..
The C language implementation of the LS command under Linux (supports-R-parameters):#include #include #include #include #include #include #include void Do_ls (char *), void Do_stat (char *,char *); void Show_ File_info (char *,struct stat
1 Basic composition of shell statementsThe shell is separated by a space between each basic constituent element.For example, [-E file],[,-E, file,] these four basic elements are separated by a space.Same reason [!-e file],[,! ,-E, file,] each of
Automated maintenance of the system with shell scripts is simple, convenient and portable.But shell scripts are read-write and are likely to leak sensitive information, such as usernames, passwords, paths, IP, and so on.Similarly, sensitive
Put a bunch of commands in the script into executable script execution;Script, file name is. SH, get hostname host nameSystem variables:ENV: View System VariablesSet: All variables can be printed with grep andExport path: Define Global variables
1. REDIRECT Symbol> Output redirected to a file or device overwriting the original file>! Output redirected to a file or device forcing overwriting of the original file>> output redirected to a file or device to append the original file2. Standard
1. Regular expressions
^
Line Start flag
$
End of line Mark
.
Match any one character
[ ]
Match any one of the characterscontained in [ character ] ,Coo[kl] matches Cook or
First, what is the regularA regular is a way to describe a character or string by combining symbols with special meanings, called regular expressions. Or, the regular is the rule used to describe a class of things.Second, grep1. Parameters-N: Show
Change the previous code1. Infer if it is hello, and if so, it shows "Hello, how is it?" ;2. Assume that no number of parameters is added or not. The method that prompts the user to be required to use the number of parameters.3. Assuming that the
" What is Shell "Simple understanding, is the system with the computer hardware to use intermediate media, it is only a tool of the system. In fact, there is a layer of stuff between the shell and the computer hardware that is the system kernel. For
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
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