3 ms·
macOS equivalent of locate: mdfind. This actually uses Spotlight, so it can search for files by content as well as by name. # search by content: $ mdfi
by thamer 4y ago
macOS equivalent of locate: mdfind. This actually uses Spotlight, so it can search for files by content as well as by name.
# search by content:
$ mdfind some_string
# search by name:
$ mdfind -name my_file.txt
Both commands return a list of files matching the query.
- bloopernova 4y agoIf you add this to your .zshenv or similar: [[ $OSTYPE =~ ^darwin.* ]] && export FZF_CTRL_T_COMMAND="mdfind -onlyin . -name ." When you hit ctrl+t, you'll get mdfind's output for all files in the current working directory and below, auto-piped into fzf for fuzzy matching. You can do something like type "vim " then hit ctrl+t, find the file, hit enter twice to start editing it. I wrote a quick guide on installing fzf/fd/ripgrep with powerlevel10k/oh-my-zsh/zplug on MacOS, because I would get asked how to replicate my setup: https://gist.github.com/aclarknexient/0ffcb98aa262c585c49d4b3f3ae24019 https://gist.github.com/aclarknexient/0ffcb98aa262c585c49d4b...