new script to find read only files
authorChris Koeritz <fred@gruntose.com>
Tue, 29 Jan 2019 05:41:06 +0000 (00:41 -0500)
committerChris Koeritz <fred@gruntose.com>
Tue, 29 Jan 2019 05:41:06 +0000 (00:41 -0500)
very efficient.

scripts/files/find_readonly.sh [new file with mode: 0644]

diff --git a/scripts/files/find_readonly.sh b/scripts/files/find_readonly.sh
new file mode 100644 (file)
index 0000000..833dd17
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# locates read only files in the directories specified.
+# this is a much simpler and more efficient command than some i've seen
+# floating about; it gets the find command to do all the heavy lifting
+# and doesn't try to build impossibly large command lines.
+
+find "${@}" -follow -type f -perm -u+r -a ! -perm -u+w 
+