ITeye博客

UNIX: Some useful commands

jacky · 2009-08-26 12:05 · shell · Markdown

  1. To search a string from the content of files. E.g. Search 'logo.gif' from all jsp,html and xsl files under current folder
find . \( -name '*.jsp' -o -name '*.html' -o -name '*.xsl' \) -exec grep -l logo.gif {} \;
  1. To get lines in a certain range from file which is huge E.g. Get the lines from 20 to 2000 from stdout.txt
sed -n '20,2000p' stdout.txt > test.txt

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。