公司网站设计主页部分怎么做,杭州做网站小程序多少钱,微信网站开场动画,资金盘网站建设一、查看文件-----cat (详情参考:http://blog.sina.com.cn/s/blog_52f6ead0010127xm.html) 语法结构: cat 查看方式 文件 cat -A : show all 显示所有内容,相当于-vET [rootlocalhost tmp]# cat -A /etc/profile
#注释:查看/erx/目录下profile文件的内容 cat -b :对非空… 一、查看文件-----cat (详情参考:http://blog.sina.com.cn/s/blog_52f6ead0010127xm.html) 语法结构: cat 查看方式 文件 cat -A : show all 显示所有内容,相当于-vET [rootlocalhost tmp]# cat -A /etc/profile
#注释:查看/erx/目录下profile文件的内容 cat -b :对非空白行惊醒编号 [rootlocalhost tmp]# cat -b /etc/profile
注释:注查看/etc/目录下的profile内容并且对非空白行进行编号行号从1开始 cat -E :show end在每行结束的位置显示$ [rootlocalhost tmp]# cat -E^C/etc/profile
#注查看/etc/下的profile内容并且在每行的结尾处附加$符号 cat -n [rootlocalhost tmp]# cat -n /etc/profile
#注释注对/etc目录中的profile的所有的行(包括空白行进行编号输出显示 cat -T 将tab显示为^T cat -v :列出一些看不来的特殊字符 二、文件查看-----nl命令 文件文字为text.txt,作为测试文件 for i in range(10):print(大傻瓜)list[1,2,3,4,5,6,7,8]
for i in list:print(i)ok!
list[1,2,3,4,5,6,7,8]
for i in list:print(i)ok! 1、 -b 模式下的操作是否显示空白行的行号 -b a表示不论是否有空行也同样列出行号 [rootlocalhost a]# nl -b a text #显示包括空白行的行数1 for i in range(10):2 print(大傻瓜)3 4 5 6 list[1,2,3,4,5,6,7,8]7 for i in list:8 print(i)9 10 11 12 ok!13 list[1,2,3,4,5,6,7,8]14 for i in list:15 print(i)16 17 18 19 ok!20 21 22 -b t不现实空白的行数计算中跳过空白行 [rootlocalhost a]# nl -b t text #显示有效行数1 for i in range(10):# 2 print(大傻瓜)3 list[1,2,3,4,5,6,7,8]4 for i in list:5 print(i)6 ok!7 list[1,2,3,4,5,6,7,8]8 for i in list:9 print(i)10 ok! 2、-n模式 -n ln 行号显示在屏幕的最左侧 [rootlocalhost a]# nl -n ln text#行号显示在左边
1 for i in range(10):
2 print(大傻瓜)3 list[1,2,3,4,5,6,7,8]
4 for i in list:
5 print(i)6 ok!
7 list[1,2,3,4,5,6,7,8]
8 for i in list:
9 print(i)10 ok! -n rn 行号显示在屏幕的最右侧 [rootlocalhost a]# nl -n rn text #显示在屏幕的最右侧1 for i in range(10):2 print(大傻瓜)3 list[1,2,3,4,5,6,7,8]4 for i in list:5 print(i)6 ok!7 list[1,2,3,4,5,6,7,8]8 for i in list:9 print(i) -n rz 行号显示在屏幕的最右侧,前面加0 000001 for i in range(10):
000002 print(大傻瓜)000003 list[1,2,3,4,5,6,7,8]
000004 for i in list:
000005 print(i)000006 ok!
000007 list[1,2,3,4,5,6,7,8]
000008 for i in list:
000009 print(i)000010 ok! 3、-w模式缩进多少位 [rootlocalhost a]# nl -w 40 text 1 for i in range(10):2 print(大傻瓜)3 list[1,2,3,4,5,6,7,8]4 for i in list:5 print(i)6 ok!7 list[1,2,3,4,5,6,7,8]8 for i in list:9 print(i)10 ok! 三、查看文件操作-----more一页一页翻动 格式 more 【文件】 1、空格向下翻一页 2、回车向下翻一行 3、“/” 搜索 4、f 立刻显示文件名和行数 5、b翻到第一页 6、q离开 四、查看文件------less(一页一页翻动) 1、空格向下翻一页 2、pagedown:下一页 2、pageup:上一页 4、n:重复前一个搜索 5、N反方向反复前一个搜索 6、q退出 转载于:https://www.cnblogs.com/angle6-liu/p/9943574.html