Help to just print out specific line from an input file

Hi,

I have a file which contains 2,500,500,432 lines.
Can I know what command I should type in order just print out particular line from the input file?
eg. I just wanna to see what is the contents at line 522,484,612.

Thanks for advice.

sed -n '522484612' input_file

Good luck.

sed -n '522484612{;p;q;}' file

---------- Post updated at 04:28 AM ---------- Previous update was at 04:24 AM ----------

That's not a valid sed script. If I got your intention right, it ought to have been

sed -n '522484612p' input_file

But, even then it's a useless command. sed will read the whole file which is not at all required.

1 Like

With awk

 awk 'NR==522484612 {print;exit}' file
1 Like