参考文档

https://blog.csdn.net/caoshunxin01/article/details/79355566

[root@kube-node3 ~]# cat tab_space.txt

this is tab finish.
this is several space finish

[root@kube-node3 ~]# cat tab_space.txt | grep this | sed -n '1p' | cut -d ' ' -f 1
this

在 /etc/passwd 中输出第 3-5 列:
cat /etc/passwd | cut -d ':' -f 3-5

在 /etc/passwd 中输出第 3到最后一列
cat /etc/passwd | cut -d ':' -f 3-

cut字符串截取 http://blog.51cto.com/2627lounuo/1790446

去掉最后面的 && : 截取最后面&&的所有左端字符

[root@oracledb ~]# cat c.sh
yum -y install binutils && yum -y install compat-libcap1 &&
[root@oracledb ~]# str=`cat orcale_output.sh`
[root@oracledb ~]# echo ${str}
yum -y install binutils && yum -y install compat-libcap1 &&
[root@oracledb ~]# cut=${str%&&*}
[root@oracledb ~]# echo ${cut}
yum -y install binutils && yum -y install compat-libcap1

最新文章

  1. 关于Scrum团队的理解
  2. 试用 Nexus OSS 3.0 的docker仓库 (一)
  3. Excel: Switch (transpose) columns and rows
  4. POJ 2417 Discrete Logging
  5. LeeCode(Database)-Employees Earning More Than Their Managers
  6. Codeforces Round #214 (Div. 2) C. Dima and Salad (背包变形)
  7. Python 清理HTML标签相似PHP的strip_tags函数功能(二)
  8. Linux Network Management
  9. Oracle-2 - :超级适合初学者的入门级笔记--定义更改约束,视图,序列,索引,同义词
  10. 【转】构建高性能WEB站点之 吞吐率、吞吐量、TPS、性能测试
  11. Java包装类介绍与类型之间相互转换
  12. maven项目打包成war包发布到tomcat下...
  13. Vector集合
  14. WCF REST模式下的UriTemplate路径问题
  15. 【Gtk】feorda下gtk安装详解
  16. Linux SWAP 交换分区配置说明(转)
  17. Python3 字典 get() 方法
  18. Django学习笔记-2018.11.17
  19. 2017 ACM区域赛(南宁站) 参赛流水账
  20. Unity3D开发之Matrix4x4矩阵变换

热门文章

  1. 23 export default和export的使用方式
  2. python pip获取所有已安装的第三包
  3. LeetCode 308. Range Sum Query 2D - Mutable
  4. Vue.js最佳实践(五招助你成为vuejs大师)
  5. 中检测到有潜在危险的 Request.Form 值。”
  6. 42 | grant之后要跟着flush privileges吗?
  7. [Luogu] 运输计划
  8. 下载MAMP
  9. linux 查询cpu版本、核心、线程脚本
  10. 使用Redis sorted set实现集合设置member过期