ls -ltr /var/log/script1/
total 5964
-rw-r--r--. 1 root root 22720 Apr 28 11:14 controller.log
-rw-r--r--. 1 root root 869 Apr 28 11:14 controller.log.2018-03-26-14
-rw-r--r--. 1 root root 893 Apr 28 11:14 controller.log.2018-03-19-13
-rw-r--r--. 1 root root 22409 Apr 28 11:14 controller.log.2018-03-19-12
-rw-r--r--. 1 root root 36918 Apr 28 11:14 controller.log.2018-04-02-05
-rw-r--r--. 1 root root 62605 Apr 28 11:14 controller.log.2018-04-02-04
Above files contains multiple " at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)" messages I want to delete it and write the rest of the messages in same file
I am using below command which prints the output :
for f in /var/log/script1/* ; do sed '/^\s*at/d' $f ; done
I tried below but no luck :
for f in /var/log/script1/* ; do sed '/^\s*at/d' $f > $f ; done
Above command return empty files. can some one please help !