In this post we will see how to find a file using command line in Ubuntu 20.04 LTS.
Basic Command to do this : find path -name filename
1.We can use find command to find a file . To find a file with exact name :
$ find ~/Desktop -name media .This command will find the exact media.
Like the way shown in below image :
2.Now to anything related to media , you can add askterisk with the command to do this .Command :
$ find ~/Desktop -name media* .Now it will show all files containing media as shown in the below pic :
3.To make the command case insensitive you need to use iname instead of name . Command :
$ find ~/Desktop -iname media* .
4.if you need to find exe file with your file name , command to do so :
$ find ~/Desktop -iname media*.exe
5.Advance find command :
a)find files in last 7 days :
$ find path -mtime -7
b)find files in last 8 minutes :
$find path -mmin -8
c)find files in last 20 days with above 5MB :
$find path -mtime 25 -size +5M