CentOS Linux 常用命令整理(文本处理,Vim 文本处理,更新于 2017 年 9 月 19 日)

更多 CentOS Linux 常用命令整理请点击这里

文本处理:

在文件 ‘/tmp/test’ 中查找 “str”:

# grep str /tmp/test

在文件 ‘/tmp/test’ 中查找以 “str” 开始的行:

# grep ^str /tmp/test

查找 ‘/tmp/test’ 文件中所有包含数字的行:

# grep [0-9] /tmp/test

在目录 ‘/tmp’ 及其子目录中查找 “str”:

# grep str -r /tmp/*

找出两个文件的不同处:

# diff file1 file2

以对比的方式显示两个文件的不同:

# sdiff file1 file2

Vim 文本处理:

《 Linux 下 Vim 入门基础 》

这篇文章对你有帮助吗?

相关文章

发表评论?

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据