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

相关文章: