msgbartop
A cronological documentation test project, nothing serious, really!
msgbarbottom

13 Oct 2008 Rename files in a folder to lower-case using perl

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' {} \;

Tags: , ,

Posted by Hans-Henry Jakobsen

01 Nov 2007 Grep recursively through subdirectories

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.

Tags: , ,

Posted by Hans-Henry Jakobsen

09 Jun 2007 Find files not readable by all (useful for web site)

find -type f ! -perm -444

Tags:

Posted by Hans-Henry Jakobsen

18 May 2007 Fikse rett dato på bildefil ut i fra EXIF info

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…)

Tags: , , ,

Posted by Hans-Henry Jakobsen

18 May 2007 Delete files older than x days

find /data/folder -type f -ctime +60 -exec /bin/rm {} \;

(more…)

Tags:

Posted by Hans-Henry Jakobsen