Skip to content

Instantly share code, notes, and snippets.

@todd-dsm
Created October 18, 2013 17:37
Show Gist options
  • Save todd-dsm/7045085 to your computer and use it in GitHub Desktop.
Save todd-dsm/7045085 to your computer and use it in GitHub Desktop.
find all files AND directories, then write to a file per this criteria: a) With World Writable permission bit set: -perm -0002 b) that are NOT of filesystem type proc: -not -fstype proc nfs c) that are NOT in these directories: '/var/tmp' '/var/tmp/*' '/tmp' '/tmp/*' '/proc' '/proc/*' '/dev' '/dev/*'
find "$sysRoot" -noleaf \( -type d -o -type f \) -perm -0002 \
-not -fstype proc \
-not -wholename '/var/tmp' -not -wholename '/var/tmp/*' \
-not -wholename '/proc' -not -wholename '/proc/*' \
-not -wholename '/tmp' -not -wholename '/tmp/*' \
-not -wholename '/dev' -not -wholename '/dev/*' \
# Write all findings to a log; 1-per-line
>> "$tmpDataFile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment