Originally Posted by (=AA=)
cat db.log | grep warning > warning-db.log
cat db.log | grep -v warning > no-warnings-db.log
warning-db.log - this would be the log file containing the warnings only.
no-warnings-db.log - this would be the log file minus the warnings.
Original log file remains untouched.
your method is simple , but I would like to keep the original file name of log to db.log , as if use your method , the file name would be changed .
The reason for do not want to change file name is because db.log is the standard file name , many users use this file name .