ifconfig | grep 'inet[^6]' | sed 's/^\s*//g' | cut -d ' ' -f2 > ips.txt

 排除127开头的IP:

ifconfig | grep 'inet[^6]' | sed 's/^\s*//g' | cut -d ' ' -f2 | sed '/^127.*/d' > ips.txt

 

相关文章:

  • 2021-12-07
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2022-02-03
  • 2021-12-03
  • 2022-12-23
  • 2021-11-18
  • 2022-01-29
  • 2022-03-01
相关资源
相似解决方案