1

Imagine I only know a part of the name of the folder(s) or file(s), but don’t know their location(s) in the computer. I even don’t know whether they are hidden or not. How can I search and list them all?

(Say, for example I want to list all the folders and files which are having mysql as the part of their name)

1
  • 1
    find is your friend: on command line, type man find. Jul 17, 2014 at 16:32

1 Answer 1

2

Maybe something like:

find / -name "*mysql*"

Or, to find case-insensitively:

find / -iname "*mysql*"

Only files? Then:

find / -type f -name "*mysql*"

Or just directories?

find / -type d -name "*mysql*"

Maybe you want to skip other filesystems, like those in /proc or /sys:

find / -xdev -name "*mysql*"

As @richard said in a comment, you should read the man page of find to find (pun intended) all it can do.

Not the answer you're looking for? Browse other questions tagged .