Reprinted from Matchless Castle | Demon Angel
When the shell edits the script, the runtime appears "': not a valid identifier", or it will appear (: Command not found, many inexplicable symbols) it is likely that you are editing under Windows,
Test can be understood to be the same as [], [[]] in logic and logic or at times, it can be split into multiple []
[Cmd-a cmd]
#!/bin/bash
a=23;
If [$a-gt 18-a $a-lt]
then
echo ' Young && handsome '
else
echo ' Just so ... "
fi
Http://www.ha97.com/4021.html
1. Delete 0-byte filesFind-type f-size 0-exec rm-rf {};
2. View processArrange by memory from large to smallPS-E-O "%c:%p:%z:%a" |sort-k5-nr
3. By CPU utilization from large to small arrangementPS-E-O "%c:%p:%z:%a"
For a host system, there will be some inaccessible users in the system, but they must also exist, what we call the inability to log on, is that this user can not use bash or other shell to login to the system, not that this account can not use other
The loop structure under the Shell is Class C, also has a for loop, while loop, in addition, the shell also has a until loop. For Loop the basic syntax for a for loop
For variable in {list}
do
statement1
statement2
... Done
The syntax
Brief Introduction
Sed is an online editor that handles a single line of content at a time. When processing, the currently processed rows are stored in a temporary buffer, known as pattern spaces, followed by the SED command to handle the contents
Judgment file:Workdir=/home/tmplocal_list_file= $WORKDIR/local.list#if no Local.txt file, generate a new oneif [!-F "$LOCAL _list_file"]; ThenTouch $LOCAL _list_fileFiNote: Be sure to have a space, to determine whether the file exists, if it does
Original:Http://blog.pureisle.net/archives/1352.html
The Shell provides a large number of basic operations that are useful in scripting. The Shell evaluates the arithmetic expression you provide, performs an operation expansion, and replaces an
Linux Shell string interception is useful, there are eight ways:
Assuming there are variable var=http://www.aaa.com/123.htm
1. # Intercept, delete left character, keep right character.
Echo ${var#*//}
where Var is the variable name, # is the
In recent time, when dealing with shell scripts, encountered time processing problems. The addition and subtraction of time, as well as the calculation of timing.
1. Time plus minus
The way to do this is to turn the base time into a timestamp,
Today, the script on the company server to get its own notebook on the run error, set-x tracking discovery is a variable in the self-increase operation error occurred, the error section of the script is probably like this:
#! /bin/sh
param=0
Gathen: 397706991, learning together
Conf/hive.xml
Specific shell code Download: http://download.csdn.net/detail/luo849278597/9490920
create table if not exists think_statistics (date_type_name string,date_name string,type int,type_ Name
Http://www.cnblogs.com/davidwang456/p/3784102.html
http://blog.csdn.net/yucan1001/article/details/8455757
http://blog.163.com/yangfan876@126/blog/static/806124562013720104712282/
1, dirs1) functionDisplays all records in the current directory
Http://www.cnblogs.com/wangkangluo1/archive/2011/09/23/2185938.html
Name: PSUsage rights: All usersHow to use: PS [options] [--help]Description: Shows the dynamics of the instantaneous stroke (process)Parameters: The parameters of PS are very many,
PrefaceThere is a problem with working today, if you copy the file in directory A to directory B (without the file in directory B), and keep the file structure in directory A. The project focuses on the following: You need to keep the structure of
Enter HBase Shell console
$HBASE _home/bin/hbase Shell
If you have Kerberos authentication, you need to use the appropriate keytab for authentication (using the Kinit command), and then use the HBase shell to enter the certificate successfully. You
Gets the names of all the folders under the specified directory/usr/and outputs:
Shell code:
1 #!/bin/bash
2 #方法一
3 dir=$ (ls-l/usr/|awk '/^d/{print $NF} ')
4 for I in $dir
5 do
6 echo $i
7 done
8 #######
9 #方法二
-dir in $ (ls/usr/)
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