Perfect tools for daily use: Difference between revisions
No edit summary |
No edit summary |
||
Line 192: | Line 192: | ||
|- | |- | ||
| 用 sed 删掉 apache 注释 | | 用 sed 删掉 apache 注释 | ||
| sed '/^#/d' apache2.conf > apache2.conf.nocomments 这行命令有点牛,一下把所有注释删掉了 | | sed '/^#/d' apache2.conf > apache2.conf.nocomments 这行命令有点牛,一下把所有注释删掉了 d 表示删除行 | ||
sed 's/old/new/g' file.txt > change.txt 把 file.txt 中的所有 old 替换为 new | |||
|- | |- | ||
| 查找文件并执行命令,\; 代表命令结束符 | | 查找文件并执行命令,\; 代表命令结束符 |