LoginSignup
2
1

More than 3 years have passed since last update.

【Linuxコマンド】 pwd コマンド オプション 一覧 【初学者必見】

Last updated at Posted at 2020-02-24

【Linuxコマンド】 pwd コマンド オプション 一覧 【初学者必見】

まとめ
Linuxコマンド一覧

pwd コマンドとは

現在の作業ディレクトリの場所をフルパスで表示するLinuxコマンドです。
"pwd" は "print working directory"の略です。

コマンドの使い方

/home/hoge
$ pwd
/home/hoge

man コマンドのオプション一覧

オプション 説明
-L シンボリックリンクを考慮せずパスを表示する      
-P シンボリックリンクの実体へのパスを表示する

-L オプション

/home/hoge
# ディレクトリ構成の確認
$ ls -l
-rw-r--r-- 1 hoge hoge   11 Feb 24 17:11 hoge.txt
drwxr-xr-x 2 hoge hoge 4096 Feb 24 17:14 test
drwxr-xr-x 2 hoge hoge 4096 Feb 24 17:15 test2
lrwxr-xr-x 2 hoge hoge 4096 Feb 24 17:15 test_link -> test2

$ cd test_link
$ pwd -L
/home/hoge/test_link

-P オプション

/home/hoge
# ディレクトリ構成の確認
$ ls -l
-rw-r--r-- 1 hoge hoge   11 Feb 24 17:11 hoge.txt
drwxr-xr-x 2 hoge hoge 4096 Feb 24 17:14 test
drwxr-xr-x 2 hoge hoge 4096 Feb 24 17:15 test2
lrwxr-xr-x 2 hoge hoge 4096 Feb 24 17:15 test_link -> test2

$ cd test_link
$ pwd -P
/home/hoge/test2

その他のLinuxコマンドのオプション一覧

pwd, mkdir, cd, cat, cp, ls, touch, less, mv, rm, ssh, man, 随時追加中

広告欄

各種開発や構築の請負や初学者向けのメンター業務してます。
ご興味お持ちいただけた方はこちらへどうぞ

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1