new script to find the latest files in a folder
[feisty_meow.git] / scripts / files / find_latest_files.sh
diff --git a/scripts/files/find_latest_files.sh b/scripts/files/find_latest_files.sh
new file mode 100755 (executable)
index 0000000..2795961
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# find last written files, made friendly for dell by avoiding the .clusterConfig directory.
+
+for pathname in "${@}"; do
+
+  echo ==============
+  echo latest on path: $pathname
+  echo
+  find "$pathname" -path "$pathname/.clusterConfig" -prune -o -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2- | head -n 20
+
+  echo; echo
+
+done
+