Linux学习笔记6 cat,tac,more,less,head,tail
来源:互联网 发布:爱上学软件下载 编辑:程序博客网 时间:2024/05/01 16:32
1.cat 查看文本内容
选项
-n
: 显示行号
[root@localhost tmp]# cat -n /etc/issue 1 CentOS release 6.8 (Final) 2 Kernel \r on an \m 3
-E
: 显示行尾结束符$
[root@localhost tmp]# cat -E /etc/issueCentOS release 6.8 (Final)$Kernel \r on an \m$$
2.tac 反向查看文本内容
[root@localhost tmp]# tac /etc/issueKernel \r on an \mCentOS release 6.8 (Final)
3.more:
查看文件内容 快捷键和man命令相同,查看文本内容最后自动退出
4. less
查看文件内容 快捷键和man命令相同, q键退出
5.head
查看文件前几行(默认前10行)
例子
[root@localhost tmp]# echo -e "1\n2\n3\n4\n5\n6\n7\n8\n9\n10"> demoecho -e "1\n2\n3\n4\n5\n6\n7\n8\n9\n10">> demo[root@localhost tmp]# head -5 demo12345[root@localhost tmp]# head -n 5 demo12345
6.tail:
选项
-f
: 打印文件新增的内容
例子
查看文件尾部几行(默认尾部10行)
[root@localhost tmp]# tail -5 demo678910[root@localhost tmp]# tail -n 5 demo678910
-f选项的作用:
[root@localhost tmp]# tail -f demo12345678910新开一个命令行,执行以下命令:[root@localhost ~]# echo "11">>/tmp/demo发现上面的命令终端尾部打印了11字符串
0 0
- Linux学习笔记6 cat,tac,more,less,head,tail
- Linux 查看文件 cat,tac,more,less,head,tail 用法
- linux常用命令touch,cat,tac,more,less,head,tail
- 文本内容查看(less/cat/tac/more/less/head/tail)
- 查看文件命令cat,more,less,tail,tac,nl,od---linux学习笔记
- linux学习笔记之-- 查看文件命令cat,more,less,tail,tac,nl,od
- 查看文件命令cat,more,less,tail,tac,nl,od---linux学习笔记
- 显示文件内容 cat tac more less head tail
- linux文件内容查看(cat,tac,nl,more,less,head,tail,od)
- linux文件内容查看(cat,tac,nl,more,less,head,tail,od)
- Linux查看文件内容的方法(cat,tac,more,less,head,tail)
- Linux 常用命令——cat, tac, nl, more, less, head, tail, od
- Linux显示文本的命令(cat, tac,more,less,head,tail,nl)
- Linux文件内容查阅 - cat, tac, nl, more, less, head, tail, od
- Linux中查看文本文件内容命令cat/tac/nl/more/less/head/tail/vi总结
- Linux档案内容查阅指令:cat tac nl more less head tail
- linux查看文本命令(cat、tac、more、less、head、tail)
- Linux学习笔记——信息显示命令cat、more、less、head和tail
- centos安装czmq
- linux设备驱动归纳总结(三):3面向对象思想和lseek
- Glide-自定义缓存
- 2017年情人节热衷旅游异性情侣占比56%
- 微信群发机器人源代码
- Linux学习笔记6 cat,tac,more,less,head,tail
- Think in JAVA中“被检查的异常”的理解
- nginx 限速功能
- windows7 Scrapy安装详细教程
- Android编程权威指南(第二版)学习笔记(二十四)—— 第24章 Looper、Handler 和 HandlerThread
- Spark性能优化:数据倾斜调优
- 【Leetcode-Java】102. Binary Tree Level Order Traversal
- moquitto安装遇到的问题
- FullCalendar控件的使用