sed - stream editor for filtering and transforming text
SYNOPSIS
sed [OPTION]... {script-only-if-no-other-script} [input-file]...
DESCRIPTION
-n, --quiet, --silent 不输出模式空间中内容
suppress automatic printing of pattern space
-e script, --expression=script 多点编辑模式
add the script to the commands to be executed
-f script-file, --file=script-file 从文件读取脚本,每行一个编辑命令
add the contents of script-file to the commands to be executed
-i[SUFFIX], --in-place[=SUFFIX] 直接在原文件编辑
edit files in place (makes backup if SUFFIX supplied)
-r, --regexp-extended 在脚本中使用扩展正则表达式
use extended regular expressions in the script.
mysql
mysql [OPTIONS] [database]
常用选项:
-uUSERNAME:用户名,默认为root;
-u, --user=name User for login if not current user.
-hHOST:远程主机(即mysql服务器)地址,默认为localhost;
-p[PASSWORD]:USERNAME所表示的用户的密码; 默认为空;
注意:mysql的用户账号由两部分组成:'USERNAME'@'HOST'; 其中HOST用于限制此用户可通过哪些远程主机连接当前的mysql服务;
HOST的表示方式,支持使用通配符:
%:匹配任意长度的任意字符;
172.16.%.%, 172.16.0.0/16
_:匹配任意单个字符;