tail -10000 file.log > file.log.bak && cat file.log.bak > file.log && rm file.log.bak 这样也有不足,考虑一下磁盘目前的大小 这样会增加磁盘的IO流