(一)通过vi编辑器来替换.vi/vim 中可以使用 :s 命令来替换字符串.:s/well/good/ 替换当前行第一个 well 为 good:s/well/good/g 替换当前行所有 well 为 good:n,$s/well/good/ 替换第 n 行开始到最后一行中每一行的第一个 well 为 good:n,$s/well/good/g 替换第 n 行开始到最后一行中每一行所有 well 为 goodn 为数字,若 n 为 .,表示从当前行开始到最后一行:%s/well/good/(
sed -e 4a\newLine testfile 首先查看testfile中的内容如下: $ cat testfile #查看testfile 中的内容 HELLO LINUX! Linux is a free unix-type opterating system. This is a linux testfile! Linux test 使用sed命令后,输出结果如下: $ sed -e 4a\newline testfile #使用sed 在第四行后添加新字符串 HELLO LINUX
可对照查看网盘ASCII表http://yunpan.cn/cyxg4wQjQaGEQ (提取码:8b29) public static void main(String[] args) { // // TODO Auto-generated method stub int a=001; int b=32;//制表符 int c=13;//回车键 char character = (char)a; char cb = (char)b; String line ="niaho" + ch