I. Review of BASIC commandsDate//day and time displayedWHO//view all users logged in to the systemecho//Display the input contentFile Operation classLS//List file listCAT//Display file contentsNumber of words in WC//statistics fileCP//Copy
#! /bin/shA= "Hello World"echo "A is"Echo $aecho ""echo "A is $a"Results of the output:A isHello WorldA is Hello World2 Getting the system time:Get today's period: ' Date +%y%m%d ' or ' date +%f ' or $ (date +%y%m%d)Get yesterday's period: ' Date-d
First, Introduction:HBase shell using the process, using the CRT client, the command input can not be deleted has been trapped around me, today finally unbearable, a few degrees Niang, Google, finally have a solution, special share to
The execution name of this program$n the nth parameter value of this program, n=1..9$* all parameters of this program, this option can have more than 9 parameters.$# the number of parameters for this program$$ the PID of this program (the current
parameter Handling
Description
$#
The number of arguments passed to the script
$*
Displays all parameters passed to the script in a single string
$$
The current process ID number for the
37. Adjust the properties of a variable
Read-only variable: use the readonly commandReadOnly variable Name
ReadOnly Other uses
ReadOnly or readonly-p: Displays a list of variables that currently have read-only properties
Tag: Shell Determines whether the input is valid IP shell determines whether the input is a letter1. Purpose of demandRecently in the study of ansible automation tools, in the host table (/etc/ansible/hosts) Add Management node information, a few to
Many times backups usually use a date-based folder to create folders, and for these date folders There are a lot of subfolders, and for these date files are removed all the time, it is a bit of a struggle to combine RM or delete with find. This
There are eight ways to intercept a string, mainly for the following methodsThere are a number of ways to intercept strings in the shell, ${expression} There are 9 ways to use them.
The shell terminal only displays the user name, hostname, working directory by default, and sometimes we need to simply tweak the information displayed on the shell terminal to make the work more efficient. For example, we can add time to the shell
There are a lot of uses for the For loop in the shell, and I've been trying to summarize what I saw on the web today about the for loop usage.Knot, feel very comprehensive, so turn around research and research, hey ...1, for ((i=1;i2. Common in
When the shell executes a command, it returns a return value that is saved in the shell variable $? In When $? = = 0 o'clock, indicating successful execution; = = 1 o'clock, which indicates that the execution failed.' | | 'Left command returns FALSE,
Set to white on black backgroundEcho-e "/033[037;40m"Color is selected by adding a dedicated sequence-basically a numeric value sandwiched between "/e[" and "M". If more than one numeric code is specified, separate them with semicolons.Echo-e "/e[31;
#数字段形式For i in {1..10}DoEcho $iDone#详细列出 (characters and not many items)For File in 1 2 3 4 5DoEcho $FileDone#对存在的文件进行循环For shname in ' LS *.sh 'DoName= ' echo ' $shname | Awk-f. ' {print '} 'Echo $nameDone#查找循环 (This method can also be used when
If you need to modify the default shell (typically the bash shell), use it handy. Check the shell types available for your system first[email protected] ~]$ chsh-l/bin/sh/bin/bash/sbin/nologin/bin/tcsh/bin/csh/bin/kshModify the current shell[email
Shell script Learning1111111111111 clear the simple command script of the messages log file under/var/log/Var/log/the system file under the log file must have the root permission:$ UID is the global variable of the system:Make & make install
Shell exits and returns a 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 is not
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.