Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

Articles are written in English. The Thai translation button opens Google Translate; code and commands stay in their original form.

Linux Commands / IT Support Guides

Navigate Linux paths with pwd and ls

Use pwd to check which folder your terminal is in, then use ls to see what is there.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution

Understand the problem

A relative path such as report.txt starts from your current directory. An absolute path such as /tmp/report.txt starts from the root of the filesystem.

Run the command

Run the two commands in the terminal that reported the problem. They take no arguments and only display information.

pwd
ls -lah

Read the output

The first line, such as /home/kim, is the current directory. In the listing, -l shows details, -a includes names beginning with a dot, and -h shows sizes with units such as K and M.

Choose the next step

If you are in the wrong directory, use cd with the intended directory or use an absolute file path. Run pwd again to confirm where you are.

Before making changes

If a shortcut path may point somewhere unexpected, run pwd -P to show the physical location. Confirm the path before editing or deleting anything.

Source & further reading

GNU Coreutils — pwd invocation

Independently written summary reviewed on 2026-11-01. The example illustrates a possible application; it is not a client case study.

Share this article

Back to all articles