find to exclude hidden files

I needed to clean up my home account, to remove all the usual files, except for the hidden files (the various gnome/app confs/settings etc) into one directory. This is what I used:

find . -type f -maxdepth 1 ( ! -regex '.*/..*' ) -exec mv -vf {} all ;

I got the regex part from here:
http://www.linuxquestions.org/questions/linux-general-1/how-do-i-make-find-exclude-hidden-files-files-613793/

Also, later I found another one that I vent tried yet, maybe later:

http://www.linuxquestions.org/questions/linux-newbie-8/delete-regular-files-not-hidden-files-with-find-rm-in-one-line-older-than-15-a-855070/


find /home -type f -mtime +15 -not -name ".*" -exec rm {} ;

Leave a Reply