1、创建/data/xusx目录。

[root@localhost ~]# mkdir -p /data/xusx

2、创建文件。

[root@localhost xusx]# touch xusx.txt

3、文件写入内容

[root@localhost xusx]# cat >>xusx.txt<< EOF
> inet addr:10.0.0.8
> Bcast:10.0.0.255
> Mask:255.255.255.0
> EOF

4、用awk过滤文件内容输出

[root@localhost xusx]# awk -F ":" '{print $2}' xusx.txt
10.0.0.8
10.0.0.255
255.255.255.0

相关文章:

  • 2021-07-22
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-06-30
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2021-11-01
  • 2022-12-23
  • 2021-11-20
  • 2022-01-27
  • 2021-12-05
相关资源
相似解决方案