This is a simple oneliner to rename files to lower-case using perl
# perl -e 'rename($_, lc) || warn "$_: $!\n" for @ARGV' *
You can also do this recusively using find and perl
# find . -type f -exec perl -e 'rename($_, lc) || warn "$_: $!\n" for @ARGV' {} \;
Posted by Hans-Henry Jakobsen
grep recursively through subdirectories for files that match a specific pattern:
grep -l -r –include=*.doc regex *
The equivalent command unsing find:
find . -name ‘*.doc’ -exec grep -l regex \{\} \;
The option after grep is the lowercase letter L, not the number 1).
Remove the -l to see the actual matches instead of the file names.
Posted by Hans-Henry Jakobsen
find -type f ! -perm -444
Tags: find
Posted by Hans-Henry Jakobsen
Av og til kopierer man bilder og da kan det hende bildefila får feil dato og tid for når bildet ble tatt. Kjør dette scriptet er for å rette dette igjen
(more…)
Posted by Hans-Henry Jakobsen
find /data/folder -type f -ctime +60 -exec /bin/rm {} \;
Tags: find
Posted by Hans-Henry Jakobsen