I have a scenario where i have to I need to find the files for a specific year for eg- 2012 and empty the files. Trying to use the below command which is throwing
#!/bin/bash
find . -type f -newermt 2012-01-01 ! -newermt 2012-01-01 -exec truncate -s 0 {} \;
find: invalid predicate `-newermt' error Below is the command
Strange thing is this command works for some people.Found that there may be some version compatibility issue for the find with the predicate 'newermt' for my system. So just wanted to check
1. So how can i resolve the above error
2. Is there any way by which i can perform my task i.e, - find the files for a specific year for eg- 2012 and empty the files.