在shell中,可以使用pwd命令來獲取當前目錄的絕對路徑。pwd代表"print working directory",它會輸出當前所在的目錄的絕對路徑。
pwd
例如,在終端中輸入以下命令:
$ pwd
輸出會是當前所在目錄的絕對路徑,類似于:
/home/user/Documents