echo usage

echo -e "\e[1;42m green background \e[0m" #Print color background\e[1;42m set the color to green\e[0m
reset the initial value 0 black 40 red 41 green 42 yellow 43 blue 44 magenta 45 cyan 46 white 47
echo -n #do not wrap output
echo -e # handle special characters, turn on escaping

\ backslash backslash character

   \a     alert (BEL)  警示字符

   \b     backspace  退格

   \c     produce no further output 参数之后的字符,都被忽略掉

   \e     escape

   \f     form feed 清除屏幕

   \n     new line  换行

   \r     carriage return 回车

   \t     horizontal tab 水平制表符

   \v     vertical tab  垂直制表符

   \0NNN  byte with octal value NNN (1 to 3 digits)  八进制值NNN(1到3位)的字节

   \xHH   byte with hexadecimal value HH (1 to 2 digits)  具有十六进制值HH的字节(1到2位)

Clean up the log

echo "" > file.log        #日志文件过大的话,可以用这方法进行定期清理

Guess you like

Origin blog.51cto.com/6519883/2608210