码迷,mamicode.com
首页 > 系统相关 > 详细

Linux 常用命令(三)

时间:2018-11-18 11:37:16      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:specified   支持   first   分隔符   编辑   section   als   方向   不可   

一、less  --分页查看文件:方面查阅(编辑)大文件

  说明:支持方向键盘和鼠标向上向下浏览

  -N 显示行号技术分享图片

二、head  --output the first  part of files

  默认显示文件前10行

  -n:显示前n行技术分享图片

  -v--verbose:开头显示文件名技术分享图片

三、tail  --output the last part of files 

  默认显示最后10行

  -n:显示最后n行

  -v:显示文件名

  -f:随时显示追加的内容技术分享图片

  技术分享图片技术分享图片

 

四、cut  --remove sections from each line of files

  -b  --bytes:select only these bytes

  -c  --character:select only these characters

  

  -d, --delimiter=DELIM
  use DELIM instead of TAB for field delimiter

  -f, --fields=LIST
  select only these fields; also print any line that contains no
  delimiter character, unless the -s option is specified

  示例:技术分享图片

  显示第一行第二个0

[root@gaogzhen gaogzhen]# head -1 /etc/passwd|cut -d : -f4
0

  显示不可见字符:技术分享图片

    技术分享图片

  cut默认以tab为分隔符:技术分享图片

  以空格分隔符示例:技术分享图片

  只支持单个分隔符:技术分享图片

 

Linux 常用命令(三)

标签:specified   支持   first   分隔符   编辑   section   als   方向   不可   

原文地址:https://www.cnblogs.com/gaogzhen/p/9977128.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!