여러가지 / / 2023. 1. 10. 10:57

mac의 finder의 현재 디렉토리로 쉘을 이동

mac을 사용할 때 finder에서 보고 있는 디렉토리를 shell에서 그대로 열고 싶다면 아래 스크립트를 환경설정 파일에 추가하면 된다. [.bash_profile or .zshrc]

cdf() {  # short for cdfinder
  cd "`osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)'`"
}

위부분을 환경설정 파일에 추가한 다음 shell에서 cdf를 실행하면 현재 finder에 열려있는 디렉토리로 shell 경로가 이동된다.

반응형
  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유