[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: what happens to the rest of a file piped to head/tail?
> Is it possible to cat a file, and remove the top 20 lines?
> For example,
> cat /etc/file | head -20
> would give me the top 20 lines of a file, however, I am really interested
> in the rest of the file, however I am not certain just how many lines are
> in the total file, so | tail -? would just not suffice.
Charles E. Cheese:
tail +n will give you the end of a file, starting at line n. To use your
example above, to get "the rest of the file" you'd type:
tail +21 /etc/file
No "cat" necessary.
To unsubscribe, send email to email@example.com with
"unsubscribe luci-discuss" in the body.