This post is written by YoungJ-Baek

1. Preface

Sometimes, you need current location in terminal. In this case, you can use pwd command.

2. pwd

2.1. Command

pwd is the abbreviation of Print Working Directory. It returns working directory name, printing at the terminal.

Command

$ pwd [-L | -P]

2.2. Option

You can see two options in chapter 2.1, -L and -P. Two of them are logical directory and physical directory, respectively. The default option is -L, display the logical current working directory.

In contrast, -P option displays the physical current working directory which means all symbolic links resolved.

Option Description Remark
-L Display the logical current working directory  
-P Display the physical current working directory all symbolic links resolved

2.3. Location

MacOS 13.0

$ which pwd
pwd: shell built-in command

Leave a comment