---
title: "UNIX: Some useful commands "
author: "jacky"
date: "2009-08-26T12:05:56Z"
tags: []
slug: "unix-some-useful-commands"
draft: false
lastmod: "2009-08-26T13:05:39Z"
id: 457816
url: "https://jacky.iteye.com/blog/457816"
---

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


```shell
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


```shell
sed -n '20,2000p' stdout.txt > test.txt
```