Linux Bash: Delete certain file types on your hard drives (no recycling bin)
What is the command „find“?
Okay, imagine your computer’s hard drive is like a giant library, full of books (files) in different rooms (folders).
The find
command is like a super-smart librarian that helps you locate specific books based on certain criteria.
I create for my videos on YouTube (and Dailymotion) a lot of .mp4 files, because Kdenlive cannot use the container MOV. Kdenlive change it into the .mp4 file format.
The mp4 files are bigger as mov files. For this reason, it is nice, when I should delete it after creating the video.
But if you did it, you are in hurry, but then you forget to delete the files, but they are still on hard drive.
Then it is useful to use this command:

If you only want to count the files instead of to see all files, then you can use this command:
find 05_Mai_2025/ -name „*.mp4“ | wc -l
the last character is a little l, l like Lima, Leverkusen
If you want to delete (be carefully, there is no recycling bin) you can use this command:
find -L 05_Mai_2025/ -name „*.mp4“ -delete
Data files that were changed in the last 7 days:
find 05_Mai_2025/ -name „*.mp4“ -mtime -7
Data files that were older than 30 days:
find 05_Mai_2025/ -name „*.mp4“ -mtime +30
Data files that were bigger than 1GB:
find 05_Mai_2025/ -name „*.mp4“ -size +1G
Data files that were smaller than 100 MB:
find 05_Mai_2025/ -name „*.mp4“ -size -100M
Data files that have a special permission:
find 05_Mai_2025/ -name „*.mp4“ -perm 644
Owner can write and read, the group only to read