Considering if I list files in a directory:
drwx--x--x 43 root wheel 4.0K Aug 18 12:52 ..
-rw------- 1 root root 268K Aug 18 04:31 build_locale_databases_log
-rw------- 1 root root 5.2M Aug 18 17:21 access_log
-rw------- 1 root root 85K Aug 18 17:14 cpbackup_transporter.log
-rw------- 1 root root 2.1M Aug 18 05:49 cphulkd.log
-rw------- 1 root root 3.2M Aug 18 17:19 error_log
-rw------- 1 root root 1.7M Aug 18 12:52 license_log
Here I want to clear the contents of the files which are greater than 2Mb
. (i.e) to make the file size to zero bytes for the following files:
access_log
cphulkd.log
error_log