LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Command to output file content line by line (http://www.linuxquestions.org/questions/programming-9/command-to-output-file-content-line-by-line-229819/)

aznluvsmc 09-12-2004 07:37 PM

Command to output file content line by line
 
Hi,

Is there a command that will output a requested line number of a file?

CroMagnon 09-12-2004 08:01 PM

I don't know of a specific command (there probably is one somewhere), but you can use:
Code:

head -n 100 filename | tail -n 1
to print out line 100.

arvind_sv 09-12-2004 08:45 PM

Hi,

Try this:

sed -n 100p filename

Arvind


All times are GMT -5. The time now is 12:15 AM.