Linux – Searching Mac Through Terminal

linuxmacterminal

are there any commands to search your Mac using terminal? I tried usin grep to search but it seems somewhat unresponsive and nothing comes up.

For example, I would type "grep Files" (A folder name) and it just prints a blank line and nothing happens.

Best Answer

You can also use the mdfind command in order to perform a search with Spotlight. More info here.

Use mdfind -name searchterm in order to retrieve files with the name searchterm. Use mdfind searchterm to perform a search on file name and content.

Related Question