How to Get the Current Working Directory in Linux



Linux


In this article, we show how to get the current working directory in linux.

So in the command line terminal, many times you want to know what current working directory you're in. This is the directory where you create a file, it will be saved in this file. Or you may want to know the current working directory so that you can just know so that you can navigate into another directory.

So we get the current working directory in linux simply by specifying the keyword, pwd

pwd gets us in the current working directory in a linux terminal.

This is shown in the following code below.



Running the following code above, we get the following output shown above.


Current working directory in linux


So now we can view the current working directory we are in in the linux command terminal.

And this is how to get the current working directory in linux.


Related Resources

How to Randomly Select From or Shuffle a List in Python



HTML Comment Box is loading comments...