본문으로 바로가기

맥북이나 아이맥같은 Mac OS환경의 터미널(Terminal)에서 작업하다 보면 현재 위치의 파인더(Finder)를 열어서 직관적인 UI를 보고 작업이 필요할 때가 있습니다. 

이때 pwd 명령어로 현재 경로를 검색해 파인더 앱을 켜서 찾아들어가거나 전체 Spotlight 검색을 통해 해당 폴더를 찾아 갈 수도 있지만 open 명령어를 통해 터미널 앱에서 바로 파인더(Finder) 앱을 현재 경로로 실행 시킬수 있습니다.
$ open .

▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼


참고로 open 명령어는 파인더 뿐만 아니라 특정 앱으로 파일을 실행할때 사용하는 명령어입니다. 옵션을 통해 텍스트 에디터나 다른 앱으로도 파일 실행이 가능합니다.
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-s <partial SDK name>][-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.
      If the file is in the form of a URL, the file will be opened as a URL.
Options:
      -a                Opens with the specified application.
      -b                Opens with the specified application bundle identifier.
      -e                Opens with TextEdit.
      -t                Opens with default text editor.
      -f                Reads input from standard input and opens with TextEdit.
      -F  --fresh       Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal      Selects in the Finder instead of opening.
      -W, --wait-apps   Blocks until the used applications are closed (even if they were already running).
          --args        All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new         Open a new instance of the application even if one is already running.
      -j, --hide        Launches the app hidden.
      -g, --background  Does not bring the application to the foreground.
      -h, --header      Searches header file locations for headers matching the given filenames, and opens them.
      -s                For -h, the SDK to use; if supplied, only SDKs whose names contain the argument value are searched.
                        Otherwise the highest versioned SDK in each platform is used.


반대로 파인더에서 바로 터미널을 오픈하는 방법이 궁금하신 분들은 아래 포스팅을 참고해 주세요.

[MacOS] 파인더에서 터미널 바로 열기