/weblogic
回车
此时如果有weblogic字符串,linux会把该字符已高亮方式显示。
退出查看页面,请按“q”键。
3、head and tail
head和tail通常使用在只需要读取文件的前几行或者后几行的情况下使用。head的功能是显示文件的前几行内容
head的语法:head [n number] filename (number 显示行数)
tail的功能恰好和head相反,只显示最后几行内容
tail的语法:tail [-n number] filename
4、nl
nl的功能和cat -n一样,同样是从第一行输出全部内容,并且把行号显示出来
nl的语法:nl 文件名
5、tail
tailf命令几乎等同于tail -f,严格说来应该与tail --follow=name更相似些。当文件改名之后它也能继续跟踪,特别适合于日志文件的跟踪(follow the growth of a log file)。与tail -f不同的是,如果文件不增长,它不会去访问磁盘文件(It is similar to tail -f but does not access the file when it is not growing. This has the side effect of not updating the access time for the file, so a filesystem flush does not occur periodically when no log activity is happening.)。tailf特别适合那些便携机上跟踪日志文件,因为它能省电,因为减少了磁盘访问嘛(tailf is extremely useful for monitoring log files on a laptop when logging is infrequent and the user desires that the hard disk spin down to conserve battery life.)。tailf命令不是个脚本,而是一个用C代码编译后的二进制执行文件,某些Linux安装之后没有这个命令,本文提供了怎么编译安装tailf命令的方法。
以上就是哪些linux命令可以用于文件读取的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
更多相关阅读请进入《Linux》频道 >>