Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试查看从该命令中提取第三行的最佳方法,但我似乎无法理解
awk 'BEGIN{while("service ipsec status" | getline x) print x}'
service ipsec status | awk 'NR==3'
使用sed:
sed
service ipsec status | sed '3!d'