mirror of
https://github.com/mr0xb/scripts.git
synced 2026-08-27 19:34:57 -04:00
add old scripts
This commit is contained in:
parent
1c58245cc5
commit
9c1772908b
18 changed files with 338 additions and 0 deletions
20
util/changed
Executable file
20
util/changed
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/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"
|
||||
Loading…
Reference in a new issue