Skip to content
Advertisement

searching a file in linux

I want to find in the system a file, and I know part name of it. How could I do that? I tried unsuccessfully the command:

find / "*partname*"

The problem is probably very easy however I cannot find a decent tutorial on searching files in linux. Please tell me what command solves my problem and if you know a good tutorial so that I can understand how to use various parameters for searching, post a link. Thank you so much.

Advertisement

Answer

Do:

find / -type f -name '*partname*'

If you know for sure that the file is in the root filesystem, then you should probably use -xdev too, to stop find from traversing other filesystem’s directories:

find / -xdev -type f -name '*partname*'
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement