Commands.page Logo

How to Find Files Modified in Last 24 Hours on Ubuntu

This guide explains how to locate files changed within the previous day on your Ubuntu system. Using the terminal and the powerful find command, you can quickly identify recent modifications without needing additional software. We will cover the specific syntax required to filter results by time and provide examples for common use cases.

Using the Find Command

The most efficient way to search for files based on modification time is the find utility. It is pre-installed on Ubuntu and allows you to search recursively through directories. To find all files modified in the last 24 hours, you need to specify the time in minutes. Since there are 1440 minutes in a day, the argument -mmin -1440 tells the system to look for files modified less than 1440 minutes ago.

Search the Current Directory

If you want to search only the folder you are currently working in and its subfolders, open your terminal and navigate to that directory. Run the following command:

find . -type f -mmin -1440

The dot (.) represents the current directory. The -type f flag ensures that only files are listed, excluding directories from the results.

Search the Entire Home Folder

To scan all files within your user home directory, replace the dot with the tilde symbol (~). This is useful if you are unsure where the file was saved. Execute this command:

find ~ -type f -mmin -1440

Search the Entire System

If you need to search every location on the drive, you must start from the root directory. This requires superuser privileges to access protected folders. Use sudo before the command:

sudo find / -type f -mmin -1440

Be aware that scanning the entire filesystem may take a significant amount of time depending on your storage size.

Display Detailed Information

By default, the commands above only print the file paths. If you need to see permissions, size, and modification dates alongside the paths, add the -ls flag to the end of your command. For example:

find ~ -type f -mmin -1440 -ls

This provides a detailed listing similar to the ls -l command for every file found within the 24-hour window.