Lesson 1 - Basic commands to navigate directories

dheeraj korangadheeraj koranga
2 min read
  1. pwd (Print Working Directory):

    • Displays your current directory (or folder) within the terminal. It's useful to know where you are within the file system.

  1. mkdir (Make Directory):

    • Creates a new directory (or folder) in the specified location.

  1. mkdir -v (Verbose Mode for mkdir):

    • Creates a directory and prints a message for each directory created. The -v flag stands for "verbose" and tells you what action was performed.

  1. mkdir -vp (Verbose + Parent Directories):

    • Creates a directory along with any necessary parent directories. The -p option allows the creation of parent directories that don't exist yet, and the -v prints the actions.

  1. ls (List):

    • Lists the files and directories in the current working directory. It shows the names of items in the directory.

  1. ls -R (Recursive List):

    • Lists files and directories recursively, showing all files in the current directory and subdirectories.

  1. cd (Change Directory):
  • Changes the current directory to another specified directory. It's how you navigate between directories.

  1. cd ..:

    • Moves you up one directory level (i.e., to the parent directory of your current directory).

  1. cd - (minus sign):

    • Switch back to the previous directory you were in before the last cd command. It acts as a toggle between two directories.

  1. cd (with no arguments):

    • It takes you back to your home directory, regardless of where you are in the file system.

0
Subscribe to my newsletter

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

Written by

dheeraj koranga
dheeraj koranga