How to find files by name in GNU/Linux

Miguel Menéndez

To find files in GNU/Linux we usually use the find command.

In the following example we will search the Documents directory (~/Documents) of the current user for all files (-type f) that contain in their name (-name) the text “sync-conflict” ( '*sync-conflict*'):

$ find ~/Documents -type f -name '*sync-conflict*'
  • -type f will only search for files
  • -type d will search only directories

See also

Comments

Found a bug? Do you think something could be improved? Feel free to let me know and I will be happy to take a look.