28
26

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

peco + spotlightで超高速にファイル名検索して開く

Last updated at Posted at 2014-06-24

目的

SpotlightのCUIであるmdfindを使って、ホームディレクトリ内を対象にファイル名で検索して開く。

設定

.bashrcとかに。

_peco_mdfind() {
  open "$(mdfind -onlyin ~/ -name $@ | peco)"
}
alias s="_peco_mdfind"

とやっておけば

~/ 23:47:57  $ s nginx.conf

でホームディレクトリ内にあるnginx.confの検索結果が出てきて選択すれば紐付けられてるアプリケーションが開く。

tips

  • mdfindの-onlyinで検索対象のディレクトリを指定出来る。
  • mdfindの-nameを省けばファイルの中身でも検索可能。

--

Alfredの'で似たようなことが出来るので、ホントに便利なのかは分からない。

28
26
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
26

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?