Re: How to print all lines of a file starting from line number X
- From: Jeremiah DeWitt Weiner <jdw@xxxxxxxxx>
- Date: Wed, 12 Jul 2006 16:35:55 +0000 (UTC)
fritz-bayer@xxxxxx <fritz-bayer@xxxxxx> wrote:
with which command can I print all lines after a certain line number. I
know that with head I can display the first X and with tail the last Y.
How do print all lines which start at a certain line until the last
line?
There are probably a thousand ways, but here's one.
If X is the number of the first line you want to see, then
sed -n X,$p filename
For example:
sadalsuud:~$ wc -l /usr/dict/words
38619 /usr/dict/words
sadalsuud:~$ sed -n -e 38617,\$p /usr/dict/words
zoom
zooms
zoos
Observe that you must escape the $ because it has special meaning to
the shell.
--
Oh to have a lodge in some vast wilderness. Where rumors of oppression
and deceit, of unsuccessful and successful wars may never reach me
anymore.
-- William Cowper
.
- References:
- How to print all lines of a file starting from line number X
- From: fritz-bayer@xxxxxx
- How to print all lines of a file starting from line number X
- Prev by Date: Re: How to print all lines of a file starting from line number X
- Next by Date: Re: cups problem
- Previous by thread: Re: How to print all lines of a file starting from line number X
- Next by thread: Re: How to print all lines of a file starting from line number X
- Index(es):
Relevant Pages
|