Okay, this is probably an evident thing but it escapes me, as in it could probably be done in a much simpler way that I'm not aware of, so far.. Say there's a "file" and I want to view only what's on line number "X" of that file, what would be the solution?
here's what i can think of:
head -X < file | tail -1 sed -n Xp < file
is there anything else (or any other way) from the standard set of unix/gnu/linux text-tools/utils?
To do this, press Esc , type the line number, and then press Shift-g . If you press Esc and then Shift-g without specifying a line number, it will take you to the last line in the file. To look for the next occurrence after the first, either press n or press / again and then press Enter .
sed -n 'Xp' theFile
, where X
is your line number and theFile
is your file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With