more less head tail cat的联系与区别
来源:互联网 发布:tensorflow linux 安装 编辑:程序博客网 时间:2024/05/07 05:30
more less head tail cat的联系与区别
相同点:都可显示文件的内容
$ cat cat_manual.txt(全部显示)
$ morecat_manual.txt (分屏显示,显示百分比,只能向后浏览文件)
$ lesscat_manual.txt (分屏显示,不显示百分比,可以向前,向后浏览文件)
$ head cat_manual.txt(显示开头几行,默认显示前十行)
$ headcat_manual.txt (显示文件的末尾几行,默认显示后10行)
不同点:
cat: 有两项功能,一是显示文件的内容,2是连接两个或多个文件,比如:
eg:cat f1 f2>f3 功能是合并f1,f2到f3.
eg:cat f1 f2 同时显示f1,f2
eg:f1 显示f1
-b:从1开始对所有非空输出行编号。 eg:$ cat -b cat_manual.txt
-n:从开始对所有输出行编号。eg:$ cat -n cat_manual.txt
-s:将多个相邻的空行合并成一个空行。eg:$ cat -s cat_manual.txt
--help:打印改命令用法。eg:$ cat --help
more:
+num:从第num行开始显示;$ more -6cat_manual.txt
-num:定义屏幕大小,为num行;eg:$ more -10 cat_manual.txt
+/pattern:从pattern 前两行开始显示;eg:$ more +/-A cat_manual.txt
-c或-p:从顶部清屏然后显示;$ more-10-c cat_manual.txt
-d:提示Press space to continue, 'q'to quit.(按空 键继续,按q键退出),禁用响铃功能; eg:$ more -help cat_manual.txt
-l:忽略Ctrl+l (换页)字符;
-p:通过清除窗口而不是滚屏来对文件进行换页。和-c参数有点相似;
-s:把连续的多个空行显示为一行;$ more -s cat_manual.txt
less:退出less使用Q
-c 从顶部(从上到下)刷新屏幕,并显示文件内容。而不是通过底部滚动完成刷新;
-f 强制打开文件,二进制文件显示时,不提示警告;
-i 搜索时忽略大小写;除非搜索串中包含大写字母;
-I 搜索时忽略大小写,除非搜索串中包含小写字母;
-m 显示读取文件的百分比; eg:$ less -m cat_manual.txt
-M 显法读取文件的百分比、行号及总行数; eg:$ less -Mcat_manual.txt
-N 在每行前输出行号; eg:$ less -N cat_manual.txt
-p pattern搜索pattern;比如在/etc/profile搜索单词MAIL,就用 less -p MAIL /etc/profile
-s 把连续多个空白行作为一个空白行显示;eg:$ less -s cat_manual.txt
head:
-q 隐藏文件名 eg:$ head -q cat_manual.txt
-v 显示文件名 eg:$ head -v cat_manual.txt
-c [-]N 显示字节数,N为文件的前面N个字节,如果前面有’-’,则表示显示每个文件除最后N个字节。eg:$ head -c 100 cat_manual.txt
-n [-]N 显示的行数, N为文件的前面N行,如果前面有’-’,则表示显示每个文件除最后N行。 eg:$ head -n 100 cat_manual.txt
tail:
-q 隐藏文件名 eg:$ tail -q cat_manual.txt
-v 显示文件名 eg:$ tail -v cat_manual.txt
-c [+]N 显示最后N个字节数,如果前面有’+’,则表示显示每个文件除开始N个字节。eg:$ tail -c 12 cat_manual.txt
-n [+]N 显示的行数, N为文件的后面N行,如果前面有’+’,则表示显示每个文件除开始N行。 eg:$ tail -n 20 cat_manual.txt
- more less head tail cat的联系与区别
- Linux下cat,more,less,head,tail的区别
- linux中cat、more、less、tail、head命令的区别
- linux中cat、more、less、tail、head命令的区别
- Linux中cat、more、less、tail、head命令的区别
- linux中cat、more、less、tail、head命令的区别
- linux中cat、more、less、tail、head命令的区别
- linux中cat、more、less、tail、head命令的区别(转载)
- Linux的环境变量PATH、 cp命令、mv命令与文档查看cat/more/less/head/tail
- 文本内容查看(less/cat/tac/more/less/head/tail)
- more/less/head/tail
- 显示文件内容 cat tac more less head tail
- [转] 文件内容查看 cat,less,more,tail,head,sed
- 信息显示命令cat、more、less、head和tail
- Linux 查看文件 cat,tac,more,less,head,tail 用法
- 文件内容查看 cat,less,more,tail,head,sed
- Linux常用命令(3):cat,more,less,head,tail
- linux常用命令touch,cat,tac,more,less,head,tail
- ajax post 跨域访问的解决
- h5离线应用
- 如何通过JQuery来实现一个弹出div
- 注解工具Androidannotations在Android-studio中的配置
- jQuery设置弹出框的位置
- more less head tail cat的联系与区别
- 第七章上机练习3 4
- MySQLIntegrityConstraintViolationException
- web.xml JSP <jsp-config>标签
- 手机获取百度地图定位
- python模块:win32com用法详解
- Java我的高效编程之环境搭建
- leetcode 37. Sudoku Solver
- SQL Server修改已有字段类型,并添加默认约束