Show just a particular line from a file

pwharff

Registered
Does anyone know how to show a particular line from a file, like say line 33 only without using a combination of tail and head commands.
 
Alternately

sed -n 'p {linenumber}' {filename}

Which, at least in 10.2.8, already is aliased to 'line'
 
Aah yes, a superior solution. Of course, I meant to add to my post above, these two will only work if you know in advance which line to pull. That is, you don't need to search through the line for specific text. If you do, there is only a small change to be made.
 
Back
Top