Tee Cat >> Test &m
Tee
To redirect output to files and screens at the same time:
Date | Tee now
Cat >> test
Use a custom delimiter to create a documentDelimiter is a delimiter, customizable, and we're using append redirectionThe above command
A problem encountered earlier is that the log file is too large to occupy the disk space and cause the build project to fail
So I wanted to write a timed task. Delete a log or compress a log file
I've been on the internet for a long time and haven't
Positional parameters can be moved left with the shift command. For example, shift 3 means that the original $ $ is now $, the original $ $, and so on, the original $ $, $ $, $ $ no move. The shift command with no parameters is equal to shift
Linux for loops can use break and continue keywords to jump out of loops, consistent with Java usage
a common for loop structure
#语法一 for
variable in value 1 value 2 value 3.
Do
program block done
# #语法二 The for
variable ' command '
do
First, there is only one type of string in the shell, no shaping or floating-point type.
However, when you define a variable, you can use single quotes, double quotes, and no quotes. Without quotes, if the variable has a white character inside it,
* Inverted quotes ' and $ () * Let's demonstrate a comparison of the output results using the inverted quotes and $ () For this result, is because the $ () in $ () has escaped to get this result because of the two \=\ in the inverted
The Find command tool is used to locate files in the directory (or even the entire file system), search Path_name-option [-print-exec-ok] #find的一般格式;
1, Find command Options (-option)
1.1. Find files and directories by name (-name):cb@standalone14:~
The writing of Linux shell scripts
VI test.sh
#!/bin/bash
###################
. /etc/profile
. ~/.bash_profile
##################
Path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Cd/home/huaxia/syslog2db&&ruby app.rb
Original address: http://www.cnblogs.com/Gukw/archive/2012/01/16/2323417.html
1,/etc/gitconfig:[GUI] encoding = Utf-8 #代码库统一用urf-8 to display Chinese in the Git GUI[i18n] commitencoding = GB2312 #log编码, window under the default gb2312,
how hbase is accessed1. Native Java API: The most conventional and efficient way to access;2, hbase shell:hbase command line tool, the simplest interface, suitable for hbase management use;3, Thrift Gateway: The use of Thrift serialization
Shell to bulk modify file name under folder:
Parameters: Incoming file path, such as:
$./batch_rename_files.bat /home/xx/channel/
#!/bin/bash
echo "Start programming ..."
# #for i in ' ls * ' CD $
# #for i in ' ls-r | grep "erl*" '
Enterprise Practice question 1: (Production actual case): monitor MySQL master-slave synchronization is abnormal, if abnormal, send sms or mail to the administrator. Note: If there is no master-slave synchronization environment, you can use the
1. Some common functions
Wildcard wildcard is a pattern matching function, the function model is roughly $ (wildcard parameter), the function's return value is the file that is actually found after the match, or other, depending on the argument,
File expression
-e filename true if filename exists
-d filename If filename is a directory, true
-F filename True if filename is a regular file
-L filename True if filename is a symbolic link
-r filename If filename is readable, true
-W filename if
First Master:
Parameters:
Run the HBase shell
hbase Shell Parameters
the shell that runs up after HBase
Try to run a few orders to find out:
Create ' T_person ', ' no ', ' name '
create ' t_person ', ' no ', ' name '
0 row (s) in 2.
Normal way:#! /bin/bashecho "Please enter your name:" Read Nameecho "your name is $name." 123456 result: [Email protected] ~]#./jiaohu.sh Please enter your name:yvesyour name is Yves. [[email protected] ~]# 12345
The following two ways to
first, use the For loop to calculate the 1-100 and. Here I list two ways, please peer more suggestions. Propose a better method or a more optimized small script program。1. With for I in mode:[[email protected] ~]# vim forin.sh #!bin/bash#The for i
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