I've written before. A problem was encountered when naming filenames automatically by date and time.#! /bin/"Pleaseinput the filename:" filenamedate3'2 days ago ' +%y%m%/home//home/$filename'_'/ home/"$filename _$date3"Output is three files23:22 20
Fundamentals of the ten-year OPS series-LinuxZeng LinContact: [Email protected]Website: www.jplatformx.comCopyright: Please do not reprint the article without permission
First, IntroductionAs scripts become more complex, you need to see where
Suppose there is a variable var=http://www.linuxidc.com/test.htmA # Intercept, delete the left character, and leave the right character.Echo ${var#*//}where Var is the variable name and the # is an operator, *//indicates that the first//number and
Take a string slice
1. Starts with the fourth string, intercepts the string to the end of the string[Email protected] ~]# myname= "Hello myworld" [[email protected] ~]# Substr=${myname:3}[[email protected] ~]# echo $substr Lo MyWorld2. Starting
Title:linux system Ecshop Take the shell method--2011-06-08 13:23Recently get a station, to ecshop take the shell not understand, led to go a lot of detours.nginx/0.8.54 server, MAGIC_QUOTES_GPC Open escape, a lot of pages have been
Shell principle Cognition:About wildcard characters in the shell *The shell expands the wildcard character before passing it to the command, such as "ls-ld/usr/include/*" first expands to "Ls-ld file-list,"View history:You can view the command
--from "Brother Bird's Linux private dish"--summarize and make it convenient for inspectionaccess to variables : EchoEcho $variableEcho $PATHEcho ${path}Configuration rules for variables1. Variables and variable contents are linked by an equal sign "
Du simple Usage exampleDu-SH xmldb/Du-Sm* | sort -n //statistics current directory size and size sorting du -sk *| sort -ndu -sk * | grep guojf //look at a person's size du -m | cut -d "/" -f 2 //See text before second/character See how
Cat stands for concatenate.Case 1.When the text files has more blank lines, we want to remove them.We can use Regex \s+ ' \ n '.Cat File.txt | TR \s ' \ n 'Cat-t file.txt # Show Tabs as ^.Cat-n file.txt # Show line numbers. Specifies current
for $! and $? This type of context-dependent variable, when it is pushed to the remote host as part of the command line, be sure to consider its particularity, otherwise the script will be difficult to execute in the way you expect, and the
First, learn Zhao Wenyu's summary script:1. Variableshost=$ (/bin/hostname)Assigns the result of the command executed in () to the host variableHost= '/bin/hostname 'Assigns the execution result inside the anti-quotation mark to the host
Presumably in the command-line mode for a long time, all look tired of that monotonous and ugly cue, the individual think also accounted for some bit, if the command long words will break.Want to change intoCD ~/touch bash_profilevim.
Syntax for the Read command command:Read [parameter] variable name commonly used parameters are as follows:-t timeout to set the time-out.-P Prompt Sets the prompt message, which will appear before the cursor.Condition test:The condition test can
Shell Foundation 1: File Security and PermissionsHttp://bbs.chinaunix.net/forum/viewtopic.php?t=434579&highlight=winggerAttached: Linux user and user group managementHttp://bbs.chinaunix.net/forum/viewtopic.php?t=438660&highlight=winggerShell Basics
The built- in command (build-in commands) is the command of the shell Build-in, and when built-in commands are used, the shell executes directly without creating a new child process. Built-in commands are used to create functional or convenient
ShellFirst, the conceptShell commonly known as shell (used to distinguish from the kernel), refers to the "provide user interface" software (command parser), will receive users ' commands, parse and invoke the corresponding application.Ii.
Linux Shell Script Raiders notesChapter III: File Operations1, the production of any size file [[email protected] dd_test]#[[email protected] dd_test]# dd If=/dev/zero of=junk.data bs=1k count=1010+0 Records in10+0 Records out10240 bytes (Ten kB)
Shell exit, return summary, shell exit summary
Common Responses in shell: exit, breakm, return
Exit:
In fact, after each command is executed, an execution state is returned!
If the execution is successful, 0 is returned.
If the execution limit
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.