0

I have log file abcd.log file of around 2GB of size, I need to keep latest contents of only 200MB size and delete previous contents by using Windows in-built tool/ command line only.

What I found is to totally truncate the file by copy, echo or touch command but these are not for my requirement.

Shamsuddin Altamash
  • 163
  • 1
  • 3
  • 11
  • It's not very efficient to delete the start of a file's contents, as you have to copy the later content to the start of the file. And you must first scan for a proper line break so that you don't cut off the middle of a line. What logger are you using? Most loggers support file rolling with a specified maximum file size. – DodgyCodeException Oct 24 '17 at 11:16
  • Its native_stderr.log file of websphere which doesn't have in-built logging support for it. – Shamsuddin Altamash Oct 24 '17 at 11:25

0 Answers0