cut [选项] [参数]
选项:

-b:表示字节
-f:表示定义字段
-c:表示字符

使用shell获得主机的ip:
1.使用ifconfig
Shell之cut
2 使用ifconfig eth1Shell之cut
3.ifconfig eth1 | grep “inet”
Shell之cut
4.这个时候使用cut不能用空格做分隔符。
荔汁
Shell之cut
5. 这个时候选择其他的分割符,比如n
Shell之cut
6. 这个时候你再使用空格做分隔符就可以了shit。
Shell之cut

相关文章:

  • 2021-11-01
  • 2021-12-07
  • 2022-12-23
  • 2021-04-30
  • 2021-11-17
  • 2021-11-13
  • 2021-09-09
  • 2022-02-19
猜你喜欢
  • 2022-01-21
  • 2021-07-03
  • 2021-08-24
  • 2021-10-19
  • 2021-08-24
  • 2021-09-14
  • 2021-09-02
相关资源
相似解决方案