shell命令-cut
来源:互联网 发布:python登录文件夹帐号 编辑:程序博客网 时间:2024/06/03 22:16
用途
从输入文件中选择一个或多个字符或字段
语法
cut -b… LIST
cut -c… LIST
cut -d… LIST
cut -f … LIST
描述
-b:以字节定位
-c:以字符定位
-d:选择分割符代替TAB
-f:以域定位
LIST用以下range表示:
N N'th byte, character or field, counted from 1 N- from N'th byte, character or field, to end of line N-M from N'th to M'th (included) byte, character or field -M from first to M'th (included) byte, character or field
举例
apuser@bj61087pcu:~$ whoapuser tty7 2016-03-10 08:39apuser pts/2 2016-03-10 14:00 (:0)apuser pts/3 2016-03-11 17:29 (:0)apuser pts/4 2016-03-14 09:31 (:0)apuser@bj61087pcu:~$ who | cut -b 3uuuuapuser@bj61087pcu:~$ who | cut -d"p" -f 2user tty7 2016-03-10 08:39user user userapuser@bj61087pcu:~$ who | cut -b 1-6apuserapuserapuserapuserapuser@bj61087pcu:~$ who | cut -c 2pppp看到某个帖子说了-c和-b的区别,下面是例子解释:[rocrocket@rocrocket programming]$ cat cut_ch.txt星期一星期二星期三星期四[rocrocket@rocrocket programming]$ cut -b 3 cut_ch.txt����[rocrocket@rocrocket programming]$ cut -c 3 cut_ch.txt一二三四但是我运行了一下,发现不对,以后再做补充
0 0
- shell cut命令
- [SHELL]:cut 命令详解
- shell中的cut命令
- shell cut命令
- shell cut命令
- shell中的cut命令
- Linux Shell 命令--cut
- shell中的cut命令
- cut命令 -- shell
- shell中的cut命令
- cut命令(shell)
- shell命令-cut
- shell中的cut命令
- shell中的cut命令
- shell cut命令具体应用
- linux shell之cut命令
- shell cut命令具体应用
- shell 的cut 命令用法
- 可扩展的web单页应用程序架构
- Andriod Studio基础界面设计
- Apache日志解读,Apache日志每列代表什么?
- 自定义控件View(一)
- undefined reference to 错误的解决方法总结
- shell命令-cut
- 校招の如何写简历
- sscanf()函数
- java--重定向/转发
- Ubuntu12.04 安装django
- H5 滚动标签 marquee
- <context:component-scan>使用说明
- Array.Sort
- tomcat 监控优化