Lost in the Terminal?

Swati VermaSwati Verma
1 min read

pwd (Print Working Directory)


pwd → Displays the absolute path of the current directory.

ls (List Directory Contents)


ls → Lists files and directories in the current directory.

Common options:

  1. ls -l → Detailed list with permissions, size, and modification time.

  1. ls -a → Shows hidden files (files starting with .).

  1. ls -lh → Human-readable file sizes.

  1. ls -lr → Reverses the order of the listing.

  1. ls -lt → Sorts files by modification time (newest last by default)

cd (Change Directory)


Moves between directories.

Common usage:

  1. cd <folder-name> → Moves into a specific folder.

  2. cd .. → Moves up one level.

  3. cd path/to/directory → Moves to a specific absolute path.

  4. cd ~ or cd → Moves to the home directory.

0
Subscribe to my newsletter

Read articles from Swati Verma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Swati Verma
Swati Verma

Growing in DevOps, together! 🤝 | Associate Software Engineer at Tech Mahindra | Enthusiastic about automation, cloud solutions, and efficient software delivery. | Let's connect, collaborate, and learn from each other!