Section Next | Prev


2.4.7 現在のディレクトリを表示(pwd)

【機能説明】
コマンド pwd は、カレント・ディレクトリ名(現在作業しているディレクトリ)を 表示します。
ディレクトリ名は、ルート・ディレクトリからのパス名(絶対パス名)によって表示 されます。
pwd : print working directory

【入力フォーマット】
pwd

【実行例】
	[student@h006 public_html]$ pwd
	/home/student/public_html
	[student@h006 public_html]$ cd /tmp
	[student@h006 tmp]$ pwd
	/tmp
	[student@h006 tmp]$ cd
	[student@h006 ~]$ pwd
	/home/student

補足
もし pwd の結果が不正な場合は、ファイルシステムの破損や、NFS サーバの障害など致命的なトラブルが考えられます。システム管理者に確認してください。

bash では、環境変数PWDにカレントディレクトリがセットされているので、

	[student@h006 ~]$ echo $PWD
	/home/student
としても、同じ値を求めることができます。

Section Next | Prev

Copyright 2007-2018 ycosSystems GettingStart/Body247.html