Linux / UNIX: Displaying Today’s Files Only

How do I list all files created today only using shell command under UNIX or Linux operating systems?

You can use the find command as follows to list today’s file in current directory only (i.e. no subdirs):
find -maxdepth 1 -type f -mtime -1
Sample outputs:

./.gtk-bookmarks
./.ICEauthority
./.bash_history
./.xsession-errors.old
./.xsession-errors
./.recently-used.xbel
./.dmrc

In this example, find todays directories only
find -maxdepth 1 -type d -mtime -1
Another old but outdated ls command hack is as follows:
ls -al --time-style=+%D | grep $(date +%D)
See the find command man page for more details:
man find

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
16 comments… add one
  • Manichattan Apr 28, 2010 @ 14:20

    Hi, I love the tips and tutorials that you provide.
    Technically, the commands above will find files that were modified in
    the last day, not created.
    Thanks,
    -manichattan

  • Dennis Apr 28, 2010 @ 22:55

    This should give you files modified today (i.e. not last 24hrs)

    find -maxdepth 1 -type f -daystart -mtime -1

    -daystart
    Measure times (for -amin, -atime, -cmin, -ctime, -mmin, and -mtime) from the beginning of today rather than from 24 hours ago. This option only affects tests which appear later on the command line.

    • muthu raman May 4, 2011 @ 13:25

      gr8 !!! thx dude… i was searching for this ‘daystart’ thing !!!!

    • Pankaj May 17, 2011 @ 12:45

      GREAT !!!!!!!!!!!!!!!
      -daystart

    • Donald Klopper Jun 24, 2015 @ 8:32

      Nice one thanks.

      I now use it with:
      less `find -maxdepth 1 -type f -daystart -mtime -1`

      which opens the latest file in less, useful for log files where only one file will have “today’s” timestamp.

  • Phil Dufault Apr 29, 2010 @ 17:33

    There is no present way to track in Unix/Linux when a file was created. Only when it was last modified. There is support for tracking this now in ext4, but hasn’t been added as it’s not standard.

  • Julie Jul 14, 2011 @ 16:11

    great ! This is helpful indeed .

  • Ramesh Oct 15, 2012 @ 17:02

    Hi ,

    This was helpful. But can anyone help me for a command which will display files in descending order of the timestamp or dates. Not able to figure it out.

    Help on this will be great . Thanks in advance !

    Regards,
    Ramesh

    • Phil Dufault Oct 15, 2012 @ 18:25

      you mean: ls -lt

  • Sweta Oct 9, 2014 @ 19:07

    hi, I want to get only filenames that are modified today.
    i tried
    ls -alog temp*.txt –time-style=+%D | grep $(date +%D). this gives me permission,size,date and filename. pls suggest how can i get only the filename.

  • Sweta Oct 9, 2014 @ 19:11

    Hi, i got the solution..Thanks

    • Gagan Dec 3, 2014 @ 14:04

      Hi Sweta,
      Please let me know the command you used for this. I have same requirement as you were looking.

      Thanks,
      Gagan

  • Phil Dufault Dec 4, 2014 @ 0:17

    This will do it, it’s not very tidy though:
    ls -Alog * –time-style=+%D | grep $(date +%D) | awk ‘{print $NF}’

  • SATYA May 23, 2016 @ 4:10

    please let me know the command, filter out the file those who are genrate after 6.30AM

  • Mayank Jan 14, 2017 @ 19:01

    How to see only the files which are created today between 10 a.m to 5
    p.m?

  • Siva Rajesh Feb 13, 2017 @ 5:12

    ls -lrt | grep “Feb 13”
    Just replace the date. :) its very simple

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.