Find files created today

I figured I would start a new category for command line quickies. Here is one that I have found very useful.

# find ./ -type f -daystart -ctime -1

This is a very nice way of finding files created today. Now this command differs from the command below.

# find ./ -type f -ctime -1

The -daystart flag will tell find to use the beginning of the day when searching for files created today. Without daystart the ctime -1 flag will tell find to find files created in the last 24 hours.

Avatar
Benjamin Cane
Principal Engineer, Vice President

Benjamin Cane is Principal Engineer at American Express. He has more than 16 years of experience with roles in both systems and software engineering. He leverages both his systems and software skills to build end-to-end platforms. Platforms, purpose built for performance and resiliency. Benjamin is also the author of Red Hat Enterprise Linux - Troubleshooting Guide (2015, Packt Publishing), and he has published many popular articles on topics such as Linux, Docker, Python, Go and Performance Tuning. Thoughts and Opinions expressed in my articles are my own.

Next
Previous

Related