Just in case anybody needs to know this: one way to see all but the first line of a file is to run the command sed '1 d'
on it.
(I was sure there was a good Unix way to do this, but it took me about 20 minutes to find it.)
Post Revisions:
There are no revisions for this post.
The other (and perhaps even more Unix-y) way is:
% tail +2 file
– C.
3/4/2006 @ 11:13 am
Grr. Crappy GNU man pages – I did try to do it with tail…
3/4/2006 @ 3:39 pm
The version on my Linux desktop (GNU tail 5.93) mentions it in the man page:
If the first character of N (the number of bytes or lines) is a ‘+’,
print beginning with the Nth item from the start of each file, otherâ€
wise, print the last N items in the file. N may have a multiplier sufâ€
fix: b 512, k 1024, m 1024*1024.
– C.
3/4/2006 @ 5:11 pm
Grr – crappy transforming man pages, silently adding text to them after I look at them!
Okay, now I see what was going on – I only looked through the options section, while the behavior in question is documented in the first paragraph after the options section. And, actually, I’m not sure the documentation (coretils 5.2.1) matches all of the options; unless I’m misreading the documentation (which is clearly by now the most likely possibility!) there’s no indication that ‘tail +2 file’ would work, as opposed to ‘tail –lines=+2 file’ or ‘tail -n +2 file’. (Both of which also work, of course.) I guess I should submit a bug report.
3/5/2006 @ 10:12 am