Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    You can do "head -n 0" on Linux to mean "all lines". 
No you can't.


`head -n 99999` seems like a weird way to do it anyway. Wouldn't it make more sense to do `tail -n +1`? The output is the same from both commands, but `tail` doesn't require you to assume arbitrary limits.

Honest question, btw. I'm relatively inexperienced with Linux, and I certainly haven't used BSD. I'd appreciate any critiques you may have to offer.


> Wouldn't it make more sense to do `tail -n +1`

Yes (or perhaps tail -n +0 as that is idiomatic, which makes it clear to anyone what you are intending).


Should probably be "head -n-0".

The '-' between -n and 0 means "all but the last 0 lines".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: