Quote:
Originally Posted by sezhil80
Hi Chrish,
To list a specific line in a file, you shall use these commands.
line number =5
awk 'NR == 5' <file name>
sed -n '5q' <file name>
sed -n '6q;5p' <file name>
head -5 <filename>|tail -1 <filename>
Hope it will work,
bye
Siva
Hi,
There is a typo in sed -n '5q' <file name>. Actually, the command that is running fine is :
sed -n '5p' <file name>.
Also, clarify one more thing, what is the use of 'q' in sed command. I have seen the man pages, but couldn't find any. Also, if I am giving:
sed -n '10q;5p' <file name>, or
sed -n ';5p' <file name>, or
sed -n '5q;5p' <file name>
then also the result is same. Anybody, plz clarify !!!