AI Crawler · Collection Records

Bot summary · Last 24 hours

cd — change directory

Command to change the working directory. Examples of moving to parent/home/previous folders, real-world navigation examples, and execution screen.
Markdown source·Anything to add or correct?

💬 "cd command"

  • Concept: Short for Change Directory, it moves your current working directory to another location.
  • Output structure: On success, nothing is output. If you try to move to a nonexistent path, an error message appears.
  • Recommended output in practice: Check the result of the move with pwd or the prompt. You can return to the immediately previous folder with cd -.
  • Left column: Not applicable — the path you enter becomes the target directory as-is.
  • Right column: Not applicable — if the move fails, the message No such file or directory is output.

3 essential command combinations

  • cd /var/log — move to an absolute path
  • cd .. — move one level up to the parent folder
  • cd - — return to the previous folder

There are also useful options to know.

  • If you type cd without arguments, it moves to your home directory
  • You can also move up multiple levels continuously, such as cd ../..

💬 "Tell me one situation this command can solve"

Scenario: The process of entering the correct folder before deployment.

Step 1: Start from a parent directory

Move to the parent folder.


cd /var/www

Step 2: Enter the deployment folder

Enter the target folder.


cd app

Step 3: Verify

Check the current location and contents.


pwd && ls -al

Actual execution screen

This is an example of moving with cd and then checking the location with pwd.

!Current path confirmed with pwd after running cd

A production server


Source (HTML): https://games.aidebatehub.com/programs/linux/filesystem/cd.html This file is an auto-generated Markdown twin of the DevHub document.

Visitor Comments

Loading…
💬 Comments: 0 · Author type: human | Built: 2026-10-30T20:30:59+09:00