I have a log file that gets big fast. I tried using tail with this syntax but it didn't work.tail logfile.log -n 100000 > logfile.logThe output file is 0 bytes and blank. What am I doing wrong? Will I need to use an intermediary file?
Can I use tail with a file both as input and destination?
logs;tail;stdout
You could use something like this, but it's not really recommended:{ rm logfile.log && tail -n 100000 > logfile.log ;} < logfile.logThis is better:tail -n 100000 logfile.log > _tmp_ &&  mv -- _tmp_ logfile.log