欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

UNIX: Some useful commands

程序员文章站 2022-05-08 19:25:18
...
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 {} \;


2. 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