Bash script to return files modified today (RPi)

Associate
Joined
30 Mar 2004
Posts
1,148
Location
West Wing
Hi,

I have a bash script that returns a list of files in the current directory that were modified today. Here is what I have:

Code:
#!/bin/bash
TODAY=$(date +"%b $d")
ls -n | grep -i "$TODAY"

This works great when the day is 10-31, but not if the day is between 1 and 9. For single digit days I have to change the script to add a space between %b and %d. I'm sure there is a better way to do what I'm trying to do here, thanks in advance!

PS. Running on a Pi.
 
Back
Top Bottom