jbeadling / module-1

Command line module
0 stars 0 forks source link

Navigate to different directories using `cd` #7

Open jbeadling opened 1 year ago

jbeadling commented 1 year ago

Ticket: Navigate to Different Directories Using cd


Summary

Create a guide or tutorial demonstrating how to navigate different directories using the cd command in the command-line interface.


Description


Tasks

  1. Basic Usage:

    • Explain the simplest form of cd and how it works.
  2. Advanced Options:

    • Cover any flags or options that can be used with cd.
  3. Common Scenarios:

    • Demonstrate how to navigate to parent directories and home directories using relative vs. absolute paths.
  4. Troubleshooting:

    • List common issues users might face and how to solve them.
  5. Compile Information:

    • Create a guide or tutorial that encapsulates all the above information.

Acceptance Criteria


Priority

jbeadling commented 1 year ago

The cd command is used to change the working directory. Simply type cd along with the directory you want to move into. You can also type very specific paths and jump through several directories straight into the one you want. This is known as using relative paths. As shown below:

Image

Here I typed out the entire path from the root till the end.

You can also use a relative path which involves specifying the location of a file or directory in relation to your working directory. As shown below:

Image

Here I navigated to the web-dev directory from my home directory. I only had to specify the we-dev directory to move into it. Unlike the previous example where I specified from root.

Some common flags to use with cd:

demonstrated below:

Image

The most common issues is getting lost in the CLI, the best way to fix that is the use the pwd command. This will print out the working directory you are currently in. Anytime you are not sure simply type pwd and it will show you the absolute path you are in. As shown above.