Linux/Unix の pwd コマンド

Unix/Linux pwd コマンド。

pwd - print working directory は、現在の作業ディレクトリを取得するための Linux コマンドです。

pwd 構文

$ pwd [option]

pwd コマンドの例

ディレクトリを /usr/src ディレクトリに変更し、作業ディレクトリを出力します。

$ cd /usr/src
$ pwd
/user/src

 

ディレクトリをホーム ディレクトリに変更し、作業ディレクトリを出力します。

$ cd ~
$ pwd
/home/user

 

ディレクトリをホーム ディレクトリの親ディレクトリに変更し、作業ディレクトリを出力します。

$ cd ~/..
$ pwd
/home

 

ディレクトリをルート ディレクトリに変更し、作業ディレクトリを出力します。

$ cd /
$ pwd
/

 


Advertising

Linux
°• CmtoInchesConvert.com •°