Account
Categories

pwd command


Definition:

The pwd command stands for Present Working Directory.

When you run the pwd command, it displays your current directory.

Syntax:

pwd

Move with Absolute Path:

mv file1.txt /home/user/Documents/

Explanation:

  • file1.txt is moved to /home/user/Documents/ folder.
  • This means file1.txt was in the current directory.
  • After using the mv command, it moves to /home/user/Documents/.
  • The file name and content remain unchanged; only the location changes.

Example:

Command:

$ pwd

Explanation:

  • Running the pwd command displays the full path of the directory you are currently in.
  • You might be inside a folder but not know its exact location.
  • For example, you could be in /home/user/Documents.
  • When you run pwd, it shows the full path of your current folder.
  • It does not change anything; it only tells you where you are in the file system.