scripts/util/changed
2025-12-05 15:46:07 -05:00

20 lines
558 B
Shell
Executable file

#!/usr/bin/env bash
# Show the N most recently modified files in your home directory
# Default: 20 files, or pass a number like: ./changed.sh 50
LIMIT=${1:-20}
echo -e "\n🔍 Showing the $LIMIT most recently modified files in $HOME\n"
find "$HOME" \
-type f \
-not -path "*/.cache/*" \
-not -path "*/.config/google-chrome/*" \
-printf "%T@ %TY-%Tm-%Td %TH:%TM:%TS %p\n" \
2>/dev/null | \
sort -nr | \
head -n "$LIMIT" | \
awk '{ timestamp=$2" "$3; $1=""; $2=""; $3=""; sub(/^ +/, ""); print timestamp " -> " $0 }'
echo -e "\nDone.\n"