简单复杂化

论坛如何显示文件第500

首先想到了less +500 filename和more +500 filename

然后挑战一下极限cathead和tail一遍达到相同效果

cat -n filename|grep '^[ ]*500'
head -n 500 filename|sed -e '1,499d'
tail -n +500 filename|sed q

然后突然起来这里这么次sed……直接sed -e ‘1,499d’|sed q……

orz……简单复杂化……这么手册……

如果你喜欢这篇日志的话,欢迎订阅我的RSS Feed!
本文来源于一阁Blog。版权所有,转载请确保已阅读该页面

3 Responses to “简单复杂化”


  1. 1 mlsx

    head -n 500 filename |tail -n 1

  2. 2 yegle

    head -n 500 filename |tail -n 1

    赞发散性思维……

  3. 3 quark

    我以前只会mlsx的方法 = =

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Quote selected text






Valid XHTML 1.1