shell中獲取當前目錄

$(cd $(dirname $0); pwd)

dirname $0,取得當前執行的腳本文件的父目錄

cd到父目錄,即進入當前工做目錄

pwd顯示當前工做目錄
spa

相關文章
相關標籤/搜索