Amazon Interview Question

In Linux, what cli command will show you the current directory your working in.

Interview Answers

Anonymous

Jun 14, 2021

How to get current working directory Unix/Linux get current working directory. To get the current working directory use the pwd command. For example if we change the directory to /home/user, pwd will print /home/user as the current working directory: $ cd /home/user $ pwd /home/user In Bash shell script you can get the current working directory by: dir=$(PWD)

3

Anonymous

May 7, 2020

pwd

7