sed

SED是一个流编辑器。流编辑器用于对输入流(文件或来自管道的输入)执行基本文本转换。
虽然在某些方面类似于允许脚本编辑的编辑器,但SED通过仅对输入进行一次传递来工作,因此更有效。但是,SED能够在管道中过滤文本,这特别区别于其他类型的编辑器。

语法
sed [options]…

选项


 -e SCRIPT
 --expression=SCRIPT
     添加“脚本”到程序的运行列表

 -f SCRIPT-FILE
 --file=SCRIPT-FILE
     添加“脚本文件”到程序的运行列表

 -n
 --quiet
 --silent
      禁用自动打印,SED只会在通过“p”命令显式地发出命令时生成输出

 -h
 --help
      打印用法然后退出

 -V
 --version
     印出版本信息并退出

sed支持正则表达式(如awk),可以选择整行或文本模式.
例如.

 /REGEXP/
     这将选择与正则表达式匹配的任何行。
     如果表达式本身包含任何“/”字符,则每个字符都必须
     用反斜杠 (`\')进行转义.

 /REGEXP/I
 \%REGEXP%I
      正则表达式匹配的“I”修饰符是GNU扩展
      它使表达式以不区分大小写的方式匹配。

sed命令

a\ 在当前行下面插入文本。
i\ 在当前行上面插入文本。
c\ 把选定的行改为新的文本。
d 删除,删除选择的行。
D 删除模板块的第一行。
s 替换指定字符
h 拷贝模板块的内容到内存中的缓冲区。
H 追加模板块的内容到内存中的缓冲区。
g 获得内存缓冲区的内容,并替代当前模板块中的文本。
G 获得内存缓冲区的内容,并追加到当前模板块文本的后面。
l 列表不能打印字符的清单。
n 读取下一个输入行,用下一个命令处理新的行而不是用第一个命令。
N 追加下一个输入行到模板块后面并在二者间嵌入一个新行,改变当前行号码。
p 打印模板块的行。
P(大写) 打印模板块的第一行。
q 退出Sed。
b lable 分支到脚本中带有标记的地方,如果分支不存在则分支到脚本的末尾。
r file 从file中读行。
t label if分支,从最后一行开始,条件一旦满足或者T,t命令,将导致分支到带有标号的命令处,或者到脚本的末尾。
T label 错误分支,从最后一行开始,一旦发生错误或者T,t命令,将导致分支到带有标号的命令处,或者到脚本的末尾。
w file 写并追加模板块到file末尾。  
W file 写并追加模板块的第一行到file末尾。  
! 表示后面的命令对所有没有被选定的行发生作用。  
= 打印当前行号码。  
# 把注释扩展到下一个换行符以前。  

sed替换标记

g 表示行内全面替换。  
p 表示打印行。  
w 表示把行写入一个文件。  
x 表示互换模板块中的文本和缓冲区中的文本。  
y 表示把一个字符翻译为另外的字符(但是不用于正则表达式)
\1 子串匹配标记
& 已匹配字符串标记

sed元字符集

^ 匹配行开始,如:/^sed/匹配所有以sed开头的行。
$ 匹配行结束,如:/sed$/匹配所有以sed结尾的行。
. 匹配一个非换行符的任意字符,如:/s.d/匹配s后接一个任意字符,最后是d。
* 匹配0个或多个字符,如:/*sed/匹配所有模板是一个或多个空格后紧跟sed的行。
[] 匹配一个指定范围内的字符,如/[ss]ed/匹配sed和Sed。  
[^] 匹配一个不在指定范围内的字符,如:/[^A-RT-Z]ed/匹配不包含A-R和T-Z的一个字母开头,紧跟ed的行。
\(..\) 匹配子串,保存匹配的字符,如s/\(love\)able/\1rs,loveable被替换成lovers。
& 保存搜索字符用来替换其他字符,如s/love/**&**/,love这成**love**。
\< 匹配单词的开始,如:/\<love/匹配包含以love开头的单词的行。
\> 匹配单词的结束,如/love\>/匹配包含以love结尾的单词的行。
x\{m\} 重复字符x,m次,如:/0\{5\}/匹配包含5个0的行。
x\{m,\} 重复字符x,至少m次,如:/0\{5,\}/匹配至少有5个0的行。
x\{m,n\} 重复字符x,至少m次,不多于n次,如:/0\{5,10\}/匹配5~10个0的行。

sed 命令实例:

linux命令:sed -i 's/show_formhist = 1/show_formhist = 0/;s/confirm_submit = 0/confirm_submit = 1/g' /etc/elinks/elinks.conf; elinks -dump https://facebook.com https://facebook.com -dump elinks /etc/elinks/elinks.conf; 1/g' = 0/confirm_submit = 0/;s/confirm_submit = 1/show_formhist = 's/show_formhist -i sed sed -i 's/show_formhist = 1/show_formhist = 0/;s/confirm_submit = 0/confirm_submit = 1/g' /etc/elinks/elinks.conf; elinks -dump https://facebook.comrootopen.com
linux命令:sed -i 's/show_formhist = 1/show_formhist = 0/;s/confirm_submit = 0/confirm_submit = 1/g' /etc/elinks/elinks.conf; elinks -dump https://facebook.com https://facebook.com -dump elinks /etc/elinks/elinks.conf; 1/g' = 0/confirm_submit = 0/;s/confirm_submit = 1/show_formhist = 's/show_formhist -i sed sed -i 's/show_formhist = 1/show_formhist = 0/;s/confirm_submit = 0/confirm_submit = 1/g' /etc/elinks/elinks.conf; elinks -dump https://facebook.comrootopen.com
2019-07-09 20:56:34

linux命令:sed 's/linux-[^ ]* \{0,1\}//g' /path/to/file /path/to/file \{0,1\}//g' ]* 's/linux-[^ sed sed 's/linux-[^ ]* \{0,1\}//g' /path/to/filerootopen.com
linux命令:sed 's/linux-[^ ]* \{0,1\}//g' /path/to/file /path/to/file \{0,1\}//g' ]* 's/linux-[^ sed sed 's/linux-[^ ]* \{0,1\}//g' /path/to/filerootopen.com
2019-06-04 22:33:07

linux命令:sed 's/\r//g' < input.txt > output.txt output.txt > input.txt < 's/\r//g' sed sed 's/\r//g' < input.txt > output.txtrootopen.com
linux命令:sed 's/\r//g' < input.txt > output.txt output.txt > input.txt < 's/\r//g' sed sed 's/\r//g' < input.txt > output.txtrootopen.com
2019-06-03 22:53:52

linux命令:sed -e 's/dapper/edgy/g' -i /etc/apt/sources.list /etc/apt/sources.list -i 's/dapper/edgy/g' -e sed sed -e 's/dapper/edgy/g' -i /etc/apt/sources.listrootopen.com
linux命令:sed -e 's/dapper/edgy/g' -i /etc/apt/sources.list /etc/apt/sources.list -i 's/dapper/edgy/g' -e sed sed -e 's/dapper/edgy/g' -i /etc/apt/sources.listrootopen.com
2019-06-03 22:39:28

linux命令:sed -ne '101 p' -e '106 p' /path/to/the/file /path/to/the/file p' '106 -e p' '101 -ne sed sed -ne '101 p' -e '106 p' /path/to/the/filerootopen.com
linux命令:sed -ne '101 p' -e '106 p' /path/to/the/file /path/to/the/file p' '106 -e p' '101 -ne sed sed -ne '101 p' -e '106 p' /path/to/the/filerootopen.com
2018-12-08 17:00:28

linux命令:sed -i 's/\r//g somefile.txt somefile.txt 's/\r//g -i sed sed -i 's/\r//g somefile.txtrootopen.com
linux命令:sed -i 's/\r//g somefile.txt somefile.txt 's/\r//g -i sed sed -i 's/\r//g somefile.txtrootopen.com
2018-07-14 16:28:09

linux命令:sed 's / \“/ \\\”/ g'json_file | tr -d '\ n' | tr -d '[[:blank:]]' '[[:blank:]]' -d tr | n' '\ -d tr | g'json_file \\\”/ \“/ / 's sed sed 's / \“/ \\\”/ g'json_file | tr -d '\ n' | tr -d '[[:blank:]]'rootopen.com
linux命令:sed 's / \“/ \\\”/ g'json_file | tr -d '\ n' | tr -d '[[:blank:]]' '[[:blank:]]' -d tr | n' '\ -d tr | g'json_file \\\”/ \“/ / 's sed sed 's / \“/ \\\”/ g'json_file | tr -d '\ n' | tr -d '[[:blank:]]'rootopen.com
2018-07-14 16:06:46

linux命令:sed -e 's/ *$//' ~/.bash_history | sort | uniq -cd | sort -nr | head head | -nr sort | -cd uniq | sort | ~/.bash_history *$//' 's/ -e sed sed -e 's/ *$//' ~/.bash_history | sort | uniq -cd | sort -nr | headrootopen.com
linux命令:sed -e 's/ *$//' ~/.bash_history | sort | uniq -cd | sort -nr | head head | -nr sort | -cd uniq | sort | ~/.bash_history *$//' 's/ -e sed sed -e 's/ *$//' ~/.bash_history | sort | uniq -cd | sort -nr | headrootopen.com
2017-12-28 19:14:48

linux命令:sed '1000000!d;q' < massive-log-file.log massive-log-file.log < '1000000!d;q' sed sed '1000000!d;q' < massive-log-file.logrootopen.com
linux命令:sed '1000000!d;q' < massive-log-file.log massive-log-file.log < '1000000!d;q' sed sed '1000000!d;q' < massive-log-file.logrootopen.com
2018-01-17 10:33:48

linux命令:sed -e '/^[<space><tab>]*$/d' somefile somefile '/^[<space><tab>]*$/d' -e sed sed -e '/^[<space><tab>]*$/d' somefilerootopen.com
linux命令:sed -e '/^[<space><tab>]*$/d' somefile somefile '/^[<space><tab>]*$/d' -e sed sed -e '/^[<space><tab>]*$/d' somefilerootopen.com
2018-01-01 04:26:48

linux命令:sed -n 's/[ :]/_/g; s/^\(.\{1,\}\)_5_\($1$[$./0-9A-Za-z]\{27,31\}\)_*$/\1:\2/p' < cisco-device-config > passwd passwd > cisco-device-config < s/^\(.\{1,\}\)_5_\($1$[$./0-9A-Za-z]\{27,31\}\)_*$/\1:\2/p' :]/_/g; 's/[ -n sed sed -n 's/[ :]/_/g; s/^\(.\{1,\}\)_5_\($1$[$./0-9A-Za-z]\{27,31\}\)_*$/\1:\2/p' < cisco-device-config > passwdrootopen.com
linux命令:sed -n 's/[ :]/_/g; s/^\(.\{1,\}\)_5_\($1$[$./0-9A-Za-z]\{27,31\}\)_*$/\1:\2/p' < cisco-device-config > passwd passwd > cisco-device-config < s/^\(.\{1,\}\)_5_\($1$[$./0-9A-Za-z]\{27,31\}\)_*$/\1:\2/p' :]/_/g; 's/[ -n sed sed -n 's/[ :]/_/g; s/^\(.\{1,\}\)_5_\($1$[$./0-9A-Za-z]\{27,31\}\)_*$/\1:\2/p' < cisco-device-config > passwdrootopen.com
2018-01-31 22:00:48

linux命令:sed -i 's/OLD/NEW/g' FILE FILE 's/OLD/NEW/g' -i sed sed -i 's/OLD/NEW/g' FILErootopen.com
linux命令:sed -i 's/OLD/NEW/g' FILE FILE 's/OLD/NEW/g' -i sed sed -i 's/OLD/NEW/g' FILErootopen.com
2018-03-21 08:36:48

linux命令:sed -i.`date +%Y%m%d` -e 's/pattern/replace' [filename] [filename] 's/pattern/replace' -e +%Y%m%d` -i.`date sed sed -i.`date +%Y%m%d` -e 's/pattern/replace' [filename]rootopen.com
linux命令:sed -i.`date +%Y%m%d` -e 's/pattern/replace' [filename] [filename] 's/pattern/replace' -e +%Y%m%d` -i.`date sed sed -i.`date +%Y%m%d` -e 's/pattern/replace' [filename]rootopen.com
2018-05-11 22:52:48

linux命令:sed "s/^ABC/+ABC/" <file | sed "s/DEF$/DEF+/" | tr "\n" "~" | tr "+" "\n" | grep "^ABC" | tr "~" "\n" "\n" "~" tr | "^ABC" grep | "\n" "+" tr | "~" "\n" tr | "s/DEF$/DEF+/" sed | <file "s/^ABC/+ABC/" sed sed "s/^ABC/+ABC/" <file | sed "s/DEF$/DEF+/" | tr "\n" "~" | tr "+" "\n" | grep "^ABC" | tr "~" "\n"rootopen.com
linux命令:sed "s/^ABC/+ABC/" <file | sed "s/DEF$/DEF+/" | tr "\n" "~" | tr "+" "\n" | grep "^ABC" | tr "~" "\n" "\n" "~" tr | "^ABC" grep | "\n" "+" tr | "~" "\n" tr | "s/DEF$/DEF+/" sed | <file "s/^ABC/+ABC/" sed sed "s/^ABC/+ABC/" <file | sed "s/DEF$/DEF+/" | tr "\n" "~" | tr "+" "\n" | grep "^ABC" | tr "~" "\n"rootopen.com
2018-06-12 05:50:48

linux命令:sed -e :a -e '/$/N;s/\n/ /;ta' <filename> <filename> /;ta' '/$/N;s/\n/ -e :a -e sed sed -e :a -e '/$/N;s/\n/ /;ta' <filename>rootopen.com
linux命令:sed -e :a -e '/$/N;s/\n/ /;ta' <filename> <filename> /;ta' '/$/N;s/\n/ -e :a -e sed sed -e :a -e '/$/N;s/\n/ /;ta' <filename>rootopen.com
2017-12-27 22:14:48

linux命令:sed -e "/$USER/d;s/:.*//g" /etc/group | sed -e :a -e '/$/N;s/\n/ /;ta' /;ta' '/$/N;s/\n/ -e :a -e sed | /etc/group "/$USER/d;s/:.*//g" -e sed sed -e "/$USER/d;s/:.*//g" /etc/group | sed -e :a -e '/$/N;s/\n/ /;ta'rootopen.com
linux命令:sed -e "/$USER/d;s/:.*//g" /etc/group | sed -e :a -e '/$/N;s/\n/ /;ta' /;ta' '/$/N;s/\n/ -e :a -e sed | /etc/group "/$USER/d;s/:.*//g" -e sed sed -e "/$USER/d;s/:.*//g" /etc/group | sed -e :a -e '/$/N;s/\n/ /;ta'rootopen.com
2018-01-15 00:37:48

linux命令:sed -i '10d' <somefile> <somefile> '10d' -i sed sed -i '10d' <somefile>rootopen.com
linux命令:sed -i '10d' <somefile> <somefile> '10d' -i sed sed -i '10d' <somefile>rootopen.com
2017-12-29 12:29:48

linux命令:sed 's/$'"/`echo \\\r`/" \\\r`/" 's/$'"/`echo sed sed 's/$'"/`echo \\\r`/"rootopen.com
linux命令:sed 's/$'"/`echo \\\r`/" \\\r`/" 's/$'"/`echo sed sed 's/$'"/`echo \\\r`/"rootopen.com
2018-06-04 04:57:48

linux命令:sed '1,55d' '1,55d' sed sed '1,55d'rootopen.com
linux命令:sed '1,55d' '1,55d' sed sed '1,55d'rootopen.com
2018-02-02 11:19:48

linux命令:sed '/./,$!d' '/./,$!d' sed sed '/./,$!d'rootopen.com
linux命令:sed '/./,$!d' '/./,$!d' sed sed '/./,$!d'rootopen.com
2018-05-03 15:05:48

linux命令:sed 's/$/<ctrl+v><ctrl+m>/' 's/$/<ctrl+v><ctrl+m>/' sed sed 's/$/<ctrl+v><ctrl+m>/'rootopen.com
linux命令:sed 's/$/<ctrl+v><ctrl+m>/' 's/$/<ctrl+v><ctrl+m>/' sed sed 's/$/<ctrl+v><ctrl+m>/'rootopen.com
2018-02-22 04:22:48

linux命令:sed 's/$//' 's/$//' sed sed 's/$//'rootopen.com
linux命令:sed 's/$//' 's/$//' sed sed 's/$//'rootopen.com
2018-03-26 14:33:48

linux命令:sed '1!G;h;$!d' '1!G;h;$!d' sed sed '1!G;h;$!d'rootopen.com
linux命令:sed '1!G;h;$!d' '1!G;h;$!d' sed sed '1!G;h;$!d'rootopen.com
2018-02-07 17:12:48

linux命令:sed 's/\(..\)/\1:/g;s/:$//' mac_address_list mac_address_list 's/\(..\)/\1:/g;s/:$//' sed sed 's/\(..\)/\1:/g;s/:$//' mac_address_listrootopen.com
linux命令:sed 's/\(..\)/\1:/g;s/:$//' mac_address_list mac_address_list 's/\(..\)/\1:/g;s/:$//' sed sed 's/\(..\)/\1:/g;s/:$//' mac_address_listrootopen.com
2018-02-04 13:53:48

linux命令:sed -n -e '/postfix\/smtp\[.*status=sent/s/^.*to=<\([^>]*\).*$/\1/p' /var/log/mail.log | sort -u -u sort | /var/log/mail.log '/postfix\/smtp\[.*status=sent/s/^.*to=<\([^>]*\).*$/\1/p' -e -n sed sed -n -e '/postfix\/smtp\[.*status=sent/s/^.*to=<\([^>]*\).*$/\1/p' /var/log/mail.log | sort -urootopen.com
linux命令:sed -n -e '/postfix\/smtp\[.*status=sent/s/^.*to=<\([^>]*\).*$/\1/p' /var/log/mail.log | sort -u -u sort | /var/log/mail.log '/postfix\/smtp\[.*status=sent/s/^.*to=<\([^>]*\).*$/\1/p' -e -n sed sed -n -e '/postfix\/smtp\[.*status=sent/s/^.*to=<\([^>]*\).*$/\1/p' /var/log/mail.log | sort -urootopen.com
2018-02-14 11:22:48

linux命令:sed 's/[ \t]*$//' < emails.txt | tr 'A-Z' 'a-z' | sort | uniq > emails_sorted.txt emails_sorted.txt > uniq | sort | 'a-z' 'A-Z' tr | emails.txt < \t]*$//' 's/[ sed sed 's/[ \t]*$//' < emails.txt | tr 'A-Z' 'a-z' | sort | uniq > emails_sorted.txtrootopen.com
linux命令:sed 's/[ \t]*$//' < emails.txt | tr 'A-Z' 'a-z' | sort | uniq > emails_sorted.txt emails_sorted.txt > uniq | sort | 'a-z' 'A-Z' tr | emails.txt < \t]*$//' 's/[ sed sed 's/[ \t]*$//' < emails.txt | tr 'A-Z' 'a-z' | sort | uniq > emails_sorted.txtrootopen.com
2018-02-09 01:01:48

linux命令:sed -e "s/| /\n/g" ~/.bash_history | cut -d ' ' -f 1 | sort | uniq -c | sort -nr | head head | -nr sort | -c uniq | sort | 1 -f ' ' -d cut | ~/.bash_history /\n/g" "s/| -e sed sed -e "s/| /\n/g" ~/.bash_history | cut -d ' ' -f 1 | sort | uniq -c | sort -nr | headrootopen.com
linux命令:sed -e "s/| /\n/g" ~/.bash_history | cut -d ' ' -f 1 | sort | uniq -c | sort -nr | head head | -nr sort | -c uniq | sort | 1 -f ' ' -d cut | ~/.bash_history /\n/g" "s/| -e sed sed -e "s/| /\n/g" ~/.bash_history | cut -d ' ' -f 1 | sort | uniq -c | sort -nr | headrootopen.com
2017-12-29 07:55:48

linux命令:sed -i 8d ~/.ssh/known_hosts ~/.ssh/known_hosts 8d -i sed sed -i 8d ~/.ssh/known_hostsrootopen.com
linux命令:sed -i 8d ~/.ssh/known_hosts ~/.ssh/known_hosts 8d -i sed sed -i 8d ~/.ssh/known_hostsrootopen.com
2018-02-18 20:59:48

linux命令:sed ':a;N;$!ba;s/\n/ /g' /g' ':a;N;$!ba;s/\n/ sed sed ':a;N;$!ba;s/\n/ /g'rootopen.com
linux命令:sed ':a;N;$!ba;s/\n/ /g' /g' ':a;N;$!ba;s/\n/ sed sed ':a;N;$!ba;s/\n/ /g'rootopen.com
2018-06-06 07:00:48

linux命令:sed /BEGIN/,/END/s/xxx/yyy/g input.txt input.txt /BEGIN/,/END/s/xxx/yyy/g sed sed /BEGIN/,/END/s/xxx/yyy/g input.txtrootopen.com
linux命令:sed /BEGIN/,/END/s/xxx/yyy/g input.txt input.txt /BEGIN/,/END/s/xxx/yyy/g sed sed /BEGIN/,/END/s/xxx/yyy/g input.txtrootopen.com
2018-04-16 21:28:48

linux命令:sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' filename filename 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' -e :a -e sed sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' filenamerootopen.com
linux命令:sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' filename filename 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' -e :a -e sed sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' filenamerootopen.com
2018-05-28 17:02:48

linux命令:sed 's/\b\(0*\)//g' filename filename 's/\b\(0*\)//g' sed sed 's/\b\(0*\)//g' filenamerootopen.com
linux命令:sed 's/\b\(0*\)//g' filename filename 's/\b\(0*\)//g' sed sed 's/\b\(0*\)//g' filenamerootopen.com
2018-03-12 23:58:48

linux命令:sed -i.bak '/^[[:space:]]*$/d' file_name file_name '/^[[:space:]]*$/d' -i.bak sed sed -i.bak '/^[[:space:]]*$/d' file_namerootopen.com
linux命令:sed -i.bak '/^[[:space:]]*$/d' file_name file_name '/^[[:space:]]*$/d' -i.bak sed sed -i.bak '/^[[:space:]]*$/d' file_namerootopen.com
2018-02-22 15:53:48

linux命令:sed '/^/R addfile' targetfile > savefile savefile > targetfile addfile' '/^/R sed sed '/^/R addfile' targetfile > savefilerootopen.com
linux命令:sed '/^/R addfile' targetfile > savefile savefile > targetfile addfile' '/^/R sed sed '/^/R addfile' targetfile > savefilerootopen.com
2018-06-01 10:00:48

linux命令:sed 's/\o0/\n/g' /proc/INSERT_PID_HERE/environ /proc/INSERT_PID_HERE/environ 's/\o0/\n/g' sed sed 's/\o0/\n/g' /proc/INSERT_PID_HERE/environrootopen.com
linux命令:sed 's/\o0/\n/g' /proc/INSERT_PID_HERE/environ /proc/INSERT_PID_HERE/environ 's/\o0/\n/g' sed sed 's/\o0/\n/g' /proc/INSERT_PID_HERE/environrootopen.com
2018-02-27 04:16:48

linux命令:sed -r 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g' file.txt file.txt 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g' -r sed sed -r 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g' file.txtrootopen.com
linux命令:sed -r 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g' file.txt file.txt 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g' -r sed sed -r 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g' file.txtrootopen.com
2018-03-22 05:54:48

linux命令:sed G G sed sed Grootopen.com
linux命令:sed G G sed sed Grootopen.com
2018-01-12 22:16:48

linux命令:sed -i '/Centos/d' VirtualBox.xml VirtualBox.xml '/Centos/d' -i sed sed -i '/Centos/d' VirtualBox.xmlrootopen.com
linux命令:sed -i '/Centos/d' VirtualBox.xml VirtualBox.xml '/Centos/d' -i sed sed -i '/Centos/d' VirtualBox.xmlrootopen.com
2018-01-16 19:10:48

linux命令:sed -i 'your sed stuff here' file file here' stuff sed 'your -i sed sed -i 'your sed stuff here' filerootopen.com
linux命令:sed -i 'your sed stuff here' file file here' stuff sed 'your -i sed sed -i 'your sed stuff here' filerootopen.com
2018-03-31 12:34:48

linux命令:sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -e -e echo xargs | -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' sed sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -erootopen.com
linux命令:sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -e -e echo xargs | -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' sed sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -erootopen.com
2018-02-26 07:30:48

linux命令:sed -n -e '1,/match/p' '1,/match/p' -e -n sed sed -n -e '1,/match/p'rootopen.com
linux命令:sed -n -e '1,/match/p' '1,/match/p' -e -n sed sed -n -e '1,/match/p'rootopen.com
2018-01-21 08:52:48

linux命令:sed '/MARKER/{N;s/THIS/THAT/}' '/MARKER/{N;s/THIS/THAT/}' sed sed '/MARKER/{N;s/THIS/THAT/}'rootopen.com
linux命令:sed '/MARKER/{N;s/THIS/THAT/}' '/MARKER/{N;s/THIS/THAT/}' sed sed '/MARKER/{N;s/THIS/THAT/}'rootopen.com
2018-04-24 14:19:48

linux命令:sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" sessionstore.js | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d" > session_urls.txt session_urls.txt > "/^about:blank/d" -e "s/url:\"\([^\"]*\)\"/\1/g" -e sed }'| $1 print '{ -F"," awk | url grep | sessionstore.js {/\n/g" "s/}, -e "s/\[{/\n/g" -e sed sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" sessionstore.js | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d" > session_urls.txtrootopen.com
linux命令:sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" sessionstore.js | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d" > session_urls.txt session_urls.txt > "/^about:blank/d" -e "s/url:\"\([^\"]*\)\"/\1/g" -e sed }'| $1 print '{ -F"," awk | url grep | sessionstore.js {/\n/g" "s/}, -e "s/\[{/\n/g" -e sed sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" sessionstore.js | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d" > session_urls.txtrootopen.com
2018-02-23 16:17:48

linux命令:sed -n '/START/,${/STOP/q;p}' '/START/,${/STOP/q;p}' -n sed sed -n '/START/,${/STOP/q;p}'rootopen.com
linux命令:sed -n '/START/,${/STOP/q;p}' '/START/,${/STOP/q;p}' -n sed sed -n '/START/,${/STOP/q;p}'rootopen.com
2018-06-06 15:07:48

linux命令:sed -r 's/[ \t\r\n\v\f]+/\^J/g' INFILE > OUTFILE OUTFILE > INFILE \t\r\n\v\f]+/\^J/g' 's/[ -r sed sed -r 's/[ \t\r\n\v\f]+/\^J/g' INFILE > OUTFILErootopen.com
linux命令:sed -r 's/[ \t\r\n\v\f]+/\^J/g' INFILE > OUTFILE OUTFILE > INFILE \t\r\n\v\f]+/\^J/g' 's/[ -r sed sed -r 's/[ \t\r\n\v\f]+/\^J/g' INFILE > OUTFILErootopen.com
2018-03-12 14:12:48

linux命令:sed -n '/<Tag>/,/<\/Tag>/p' logfile.log logfile.log '/<Tag>/,/<\/Tag>/p' -n sed sed -n '/<Tag>/,/<\/Tag>/p' logfile.logrootopen.com
linux命令:sed -n '/<Tag>/,/<\/Tag>/p' logfile.log logfile.log '/<Tag>/,/<\/Tag>/p' -n sed sed -n '/<Tag>/,/<\/Tag>/p' logfile.logrootopen.com
2018-03-10 04:34:48

linux命令:sed -n 's/.*<foo>\([^<]*\)<\/foo>.*/\1/p' 's/.*<foo>\([^<]*\)<\/foo>.*/\1/p' -n sed sed -n 's/.*<foo>\([^<]*\)<\/foo>.*/\1/p'rootopen.com
linux命令:sed -n 's/.*<foo>\([^<]*\)<\/foo>.*/\1/p' 's/.*<foo>\([^<]*\)<\/foo>.*/\1/p' -n sed sed -n 's/.*<foo>\([^<]*\)<\/foo>.*/\1/p'rootopen.com
2018-02-09 18:24:48

linux命令:sed 's/,/\t/g' report.csv > report.tsv report.tsv > report.csv 's/,/\t/g' sed sed 's/,/\t/g' report.csv > report.tsvrootopen.com
linux命令:sed 's/,/\t/g' report.csv > report.tsv report.tsv > report.csv 's/,/\t/g' sed sed 's/,/\t/g' report.csv > report.tsvrootopen.com
2018-05-08 10:46:48

linux命令:sed -i 's/^.*DEBUG.*/#&/' $file $file 's/^.*DEBUG.*/#&/' -i sed sed -i 's/^.*DEBUG.*/#&/' $filerootopen.com
linux命令:sed -i 's/^.*DEBUG.*/#&/' $file $file 's/^.*DEBUG.*/#&/' -i sed sed -i 's/^.*DEBUG.*/#&/' $filerootopen.com
2018-01-16 10:16:48

linux命令:sed '/^#.*DEBUG.*/ s/^#//' $FILE $FILE s/^#//' '/^#.*DEBUG.*/ sed sed '/^#.*DEBUG.*/ s/^#//' $FILErootopen.com
linux命令:sed '/^#.*DEBUG.*/ s/^#//' $FILE $FILE s/^#//' '/^#.*DEBUG.*/ sed sed '/^#.*DEBUG.*/ s/^#//' $FILErootopen.com
2018-04-23 15:42:48

Linux的Bash命令行(A-Z排序)