revlis.nl
Stash of notes about OSS, OSes, virtualization, dev hobby projects &c
March 30, 2018 — 14:51
Just a few useful ‘find’ examples
Exclude:
find . -path ./foo -prune -o -name bar
find /home \( -path /usr/data -prune -o -path /usr/src \) -prune -o -name foo -print
find . -name Makefile -not -path foo
find . -type d ! -regex .*\/\(foo\|bar\).* \;
Permissions:
find . -perm -775
find . -perm /u+w,g+
find . -printf "%m:%f\n"
find . -printf "%m %h/%f\n"|grep -v '^\(644\|755\)'
Print date:
find -type f -printf '%TF %.8TT %p\n'
Windows:
find.exe . -name *.exe -exec certutil -hashfile {} SHA512 ; >c:\hash.txt