<p>I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both the start and end line numbers of the data that I want.</p>

<p>Does anyone know a Unix command (or series of commands) to extract all lines from a file between say line 16224 and 16482 and then redirect them into a new file?</p>

You could use 'vi' and then the following command:
```
```
:16224,16482w!/tmp/some-file
```
```
Alternatively:
```
```
cat file | head -n 16482 | tail -n 258
```
```
EDIT:- Just to add explanation, you use
head -n 16482
to display first 16482 lines then use
tail -n 258
to get last 258 lines out of the first output.