What Is My Current Directory Linux?
Contents

How do I find the current directory in Linux?

To determine the exact location of the current directory at a shell prompt and type the command pwd. This example shows that you are in the user sam’s directory, which is in the /home/ directory. The command pwd stands for print working directory.

How do I find my current working directory?

Get the current working directory: os.

os. getcwd() returns the absolute path of the working directory where Python is currently running as a string str . getcwd stands for “get current working directory”, and the Unix command pwd stands for “print working directory”.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest