has been misunderstood as the shell and command is the execution of remote commands, recently looked at the official help document only to find, made a low-level error, in fact, each module has its own application commonly used; Briefly explain the differences between several common ansible modules, so that they can summarize.1. Module command details queryAnsibl
Tutorial target: DD Wipe command disk empty shell script, notebook desktop Mac UniversalDate: August 20, 2015Contact e-mail: [Email protected]Q q Group: 1851 1570151CTO Blog Home: http://990487026.blog.51cto.comProduction demand:The number of companies reached a certain number, there will be people flow, and then the attached PC or SERVER,MAC, of course, to compl
[Awk Introduction:]
Awk can obtain part of the content from a text, or typeset the text so that it can be output in a certain format.
[Awk workflow:]
Awk will upload a row of file content to the memory and segment the content in this line (separated by spaces or tabs by default, $1, $2, $3 ...). and then read the second line to the memory... format: awk '{/pattern/command1; command2 ;...} 'File # execute the command in the matching mode, for example,
Usually how much will use the shell to write small tools, and these gadgets run the first thing is to parse parameters, here summarizes the next Shell Script processing command line parameters of the method.
A more common practice is to parse several special variables built into bash, such as traversing $* or $@ di
find the file in the current directory and then find it in its subdirectory. -Fstype: searches for files in a certain type of file system. These file system types can usually be found in the configuration file/etc/fstab, this configuration file contains information about the file system in the system. -Mount: the mount point of the file system is not crossed during file search. -Follow: If the find command encounters a symbolic link file, it will tra
Today, my company colleagues came to me and said that I was going to execute the Python script on the server with another user, but it was always done by the root user in the crontab, so I thought of a lazy way to use the shell script to switch to that user, And then execute that Python script. Ok, I'll just show you h
Chapter 2: more structured commands
ForBasic Format
for var in listdo commandsdone
You can specify the list in the following ways:1. List
for var in A B C D
If the listed strings contain special characters, such as single quotes1) Use escape characters2) double quotation marks
2. Read the list from the variable
list="A B C D"list=$list" E"for var in $list
3. Read the value from the command
for var in `cat $file`
Note: In this case, line feed is als
Shell command line, one-click creation of python Template File Script method, shellpython
When writing a python file, each file must start with a version and code. Every time I paste these two sentences after the touch file, I will be bored.
Because I have not installed python IDE tools, nor have I installed corresponding plug-ins for vim. I wrote this
in{1..10};d o if ID user$i >>/dev/null;then userdel-r user$i >/dev/nullecho "User user$i Del Successful" else echo "user$i not exits." FidoneThird, expand the above script, if add adds user user1 to User10, if del deletes the user user1 to User10. Formats such as: admin.sh--add |--delIdea: 1, if no parameters are entered, the output format is incorrect and the correct input format is displayed, then exit2, determine whether the input parameter is--ad
Cut
The cut command can extract text columns from a text file or text stream.
Cut syntax
[Root @ WWW ~] # Cut-D 'delimiter '-F fields
The PATH variable is as follows:
[root@www ~]# echo $PATH/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/games# 1 | 2 | 3 | 4 | 5 | 6 | 7
Remove the PATH variable. I want to find the fifth path.
#echo $PATH | cut -d ':' -f 5/usr/local/bin
Remove the PATH variable.
prepended to each file size, similar to Mtime. Also note that 1 megabytes uses 1M, do not use 1m[Email protected]:~/test$ ls-ltotal 8-rw-rw-r--1 ubuntu ubuntu 0 January 21:24 123.txtdrwxrwxr-x 2 ubuntu Ubuntu 4 096 January 21:37 dirone-rwxrwxrwx 1 ubuntu ubuntu 15 January 22:01 one.txt-rw-r--r--1 root root 0 January
20 21:42 roottouch-rw-rw-r--1 ubuntu ubuntu 0 January 21:18 three.txt-rw-rw-r--1 ubuntu ubuntu 0 January 20 21:18 two.txt[email protected]:~/test$ fi
Background
Title, using the ng build command on Jenkins to build a angular2 project, the console outputs the following information:
/tmp/hudson3008133988036917430.sh: Line 3:ng: Command not found
Let's examine the possible causes of this problem:
Linux Host environment variable settings failed, log on to the Linux host to execute this command will
#!/usr/bin/expectsetip10.91.96. ###### Network Segment Settime30setusername root#### #for {setip11}{$ip This article is from the "BOM water Year _" blog, please be sure to keep this source http://timefiles.blog.51cto.com/8475652/1882130Shell script Remote Batch execution command
Echo is an internal command of the shell that prints the specified string on the screen. Command format:
Echo Arg
You can use echo to achieve more complex output format control.Show escape characters
echo "\"It is a test\ ""
The result will be:"It is a test"Double quotes can also be omitted.Show variables
Name="OK"
ec
Using Linux custom auto-completion commands to improve your shell scripts, you will often write some general deployment scripts, such. /java-build.sh project name will automatically pull the project from hg, and then maven compiled and deployed to the specified server, the whole process through this shel...
Using Linux custom auto-completion commands to improve your shell scripts, you will often write some
understanding input and outputREDIRECT Error messages
Ls-al badfile 2> test4 redirection errors and data
Ls-al test test2 test3 badtest 2> test6 1> #错误输入到test6, normal data is displayed to Test7 test7 test ls-al > test2 #将标准错误和 Standard input is redirected to Test8
Redirecting output in scriptOutput text to standard error echo "This is a error message" GT;AMP;2 can use the EXEC command to tell the shell
Using Linux Custom Auto-completion commands to improve your shell scripts, you will often write some general deployment scripts, such. /The java-build.sh project name will automatically pull the project from hg, and then maven compiled and deployed to the specified server, the whole process is automated through this shell script. Www.2cto.com, but sometimes the p
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.