Search file using a file extension such as *.txt, *.png, *.mp4, *.java, *.py or *.yml etc.

$ sudo find / -type f -name “*.mp4”

OR

$ sudo find / -type f -iname “*.mp4”

Let’s Understand the above commands

sudo: privileged escalation.

-type f: Only search for files.

-type d: Only search for directories or folders.

-name “file”: File to search. It is a base of the file name (the path with the leading directories removed) that matches the shell pattern.

-iname “file”: Same as a -name except file names are not case sensitive. For example, ‘backup.txt’ will match BACKUP.txt, backup.txt, BackUp.Txt, and so on.

Thank you for reading this article, I really appreciate it. If you have any questions feel free to leave a comment.

Leave a Reply