2010-07-12 24 views

回答

1

可以使用sed来提取一个文件和/或来自标准如下

sed -n '7p' filename

some_command | sed -n '7p' 
1

这应该这样做

ifconfig | head -n 7 | tail -n 1

+0

由于一个特定的行很多帮助! – hassaanm 2010-07-12 06:00:56

+0

或者稍微简洁一些:'ifconfig |头-7 |尾巴-1' – 2010-07-12 07:04:20