: Network Disk DownloadContent Introduction······This book is a comprehensive tutorial on Linux command-line and shell script programming. The book is divided into four parts: the first part introduces the Linuxshell command line, the second part introduces the Shell
Redirection, environment variables, and Shell functions of advanced shell script Programming
Shell is not limited to simply executing commands line by line. One of the more powerful functions is the ability to create functions and function libraries. You want to customize the comm
Linux Command Line and shell script programming Daquan graphic desktop Script Programming create text menu create menu layout [plain] #! /Bin/bash clear # clear screen echo-e "\ t \ tMenu" echo-e "1. \ tDisplay disk space "echo-e" 2. \ tDisplay logged on user "echo-e" 3. \ tDisplay memory usage "echo-e" 0. \ tExit menu
Terminal printing
A terminal is an interactive tool through which users can interact with the shell environment. Printing text in a terminal is a basic task that most shell scripts and tools need to perform on a daily basis. Through the terminal printing, people can know the running state of the system, which is critical to the user.
echo Terminal printing
Copy Code code as follows:
echo
ECHO is an internal instruction of the shell to print out the specified string on the screen. Command format:
Copy Code code as follows:
Echo Arg
You can use echo to achieve more complex output format control.
Show escape characters
Copy Code code as follows:
echo "\" It is a test\ ""
The result will be:"It is a test"
Double quotes can also be omitted.
Show
Name: satool PS: it can be called a "Silly Rabbit" by a colleague ")
Function: This script can run commands in batches, copy files, and perform simple logon. You can quickly log on without remembering the specific IP address of the application server.
Note: batch management can be performed by group, with a single thread. It is not applicable to the problem that hundreds of devices in each group can be used, that is, the duration of waiting for the re
Write this blog before, I Google a bunch of related articles, mostly said to modify/etc/sudoers, and then nopasswd: designated CMD, but really no use, no remote virtual terminal This method is cloud, ubuntu10.04 Server Pro-Test!!
Remote operation with SSHcommand format
Copy Code code as follows:
Ssh-p $port $user @ $p ' cmd '
$port: SSH Connection port number
$user: SSH connection user name
$IP: IP address for SSH connection
CMD: What the remote server needs to do
control (%), format-string can be reused and all parameters can be converted.
Arguments use spaces separated by commas.
Take a look at the following example:
# format-string is double quotes
$ printf "%d%s\ n" 1 "abc"
1 ABC
# single quotes are the same as double quotes
$ printf '%d%s\ n' 1 "abc"
1 ABC
# No quotation marks can also be output
$ printf %s abcdef
ABCdef
# The format specifies only one parameter, but the extra parameter is still output in th
In general, you may need to switch the root user to another user for execution during the automation process, such as: OralceHowever, the execution of the command will return to the root user, continue to execute other commands under the root user.You need to know the parameters of the SU command-C or-sLike what:# su-oracle-c "PWD"/home/oracleOrSu-oracle-s/bin/sh test.shThe relevant commands in the test.sh
Http:// OS .51cto.com/art/200910/158857.htm
This article describes the basic knowledge of Linux script shell commands in detail, including: 1, 2, comment, 3, variable 4, environment variable, 5, Linux script shell commands, and process control.
Before giving you a detailed introduction to Linux compilation, let's f
1. For command (1) syntax for Val in list; Do commands doneThe list parameter provides some values for the iteration, and the Val value is assigned to the value in list, knowing that the list polling ends.Commands can be one or more shell commands, echo $val can view the value of the current loop (2) Read the value in the list $cat Test #!/bin/bash # Basic for
This paper mainly introduces several command modules of ansible, including:
command-Execute commands on the remote node
shell-Let the remote host execute the command under the shell process
script-Executes the loc
[SED Introduction:]
Sed is a good file processing tool, which itself is a pipe command, with the Behavior unit processing, can be used to add, select, replace, delete data rows and other operations.
SED command line format: sed [-nefri] ' range command ' file
such as: sed ' 2d ' aaa.txt # Delete file Aaa.txt second line
[sed workflow:]
When using Vim as a sc
Linux Command Line and shell script Programming
This time, I read the Linux Command Line and shell script programming book for 3rd Times. In general, this book is quite good. It is suitable for beginners. I also learned about
[awk Introduction:]
Awk can get part of the content from a single text, or typesetting the text so that it prints in some format.
[awk Workflow:]
Awk goes into memory with one line of the file, and then segments the line (by default, by Space or tab, $, $, $ ...). Then delete, and then read the second line of content to memory ...
Format: This line of awk ' {/pattern/command1; command2.} ' File # matching pattern executes the command
For example:
Tag: System replace does not have ls-l buffer null shell anonymous pipe limitReprinted from http://blog.csdn.net/hjxhjh/article/details/79095181. PrefaceThe Unix world has a famous saying: "A line of shell script is better than Mangyo C program", although this sentence is somewhat exaggerated, but it is undeniable that
Tag: Date command displays case false cmd put who bar inputShell Exercise: Write a script to do the following: Enter a number, and then run the corresponding command. The command is displayed as follows: *cmd meau** 1--date 2--ls 3--who 4--pwd When input 1 o'clock, the date command
Create functions in Linux Command Line and shell script ProgrammingBASIC script function creation function 1. use the function keyword, followed by the function name [plain] function name {commands} 2. the function name is followed by an empty parentheses, indicating that a function is being defined [plain] name () {co
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.