Date: Tue, 9 Oct 2001 14:49:00 +1000 From: "Pietralla, Siegfried P" <siegfried.pietralla@eds.com> To: "'BSD Freak'" <bsd-freak@mbox.com.au>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG> Subject: RE: Outputing a specific line number to standard output Message-ID: <16649A8D5C73D51183B80008C728EEB7CC09E6@AUSYM103>
next in thread | raw e-mail | index | archive | help
hi there, two simple ways: using awk: $ awk 'NR==54{print;exit}' myfile.txt using head and tail: $ tail +54 myfile.txt | head -1 regards, siegfried. -----Original Message----- From: BSD Freak [mailto:bsd-freak@mbox.com.au] Sent: Tuesday, 9 October 2001 14:30 To: FreeBSD Questions Subject: Outputing a specific line number to standard output Hi all, I feel stupid asking this but I have looked in the man page for grep, sort , cat, head and cut and have not been able to find the answer. How do I output to standard output a particular line number in a text file? For example say I want to display line 54 in the file myfile.txt . How do I do this? Thanks in advance..... --------------------------------------------------------------------- mBox is unified messaging and now has the mBeeper! Be the first to trial it. http://www.mbox.com.au/mbeeper To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16649A8D5C73D51183B80008C728EEB7CC09E6>