OpenWrt_Luci_Lua/1_3.test_code/sed_test/sed命令学习.txt

11 lines
235 B
Plaintext
Raw Permalink Normal View History

2015-06-28 06:39:56 +00:00
移除空白行:
sed -i '/^$/d' file
在指定行前加#号,注释该行:
sed -i '/tacb/s/^/#/g' /etc/crontabs/root
取消#号,取消注释:
sed -i '/hello/s/^#//' /etc/crontabs/root
cat t.txt|sed -n -e 's/^#\(.*\)/\1/p'