1

I want to cut the last 500 lines from a logfile and save it to a new file. Is there any unix command for this?

1 Answers1

7
tail -n 500 logfile >newfile

should do the trick.

womble
  • 97,049
  • Doesn't actually remove the lines from the original file, but I'm sure he didn't want to do that anyway. – mfinni Aug 04 '11 at 02:45