Change Directory
Part of the Fundamentals section of Coddy's Terminal journey — lesson 6 of 82.
The cd command stands for Change Directory. It lets you navigate from one folder to another in the filesystem.
To move into a folder, type cd followed by the folder name:
cd documentsAfter running this, you are now inside the documents folder. You can confirm this with pwd:
/home/documentsUseful ways to use cd:
cd .. — move up one level to the parent directory:
cd ..cd ~ — go directly to your home directory from anywhere:
cd ~cd / — go to the root directory, the very top of the filesystem:
cd /cd - — go back to the previous directory you were in:
cd -Tip: You can combine cd with ls and pwd to explore your filesystem confidently — list what's there, move into it, and confirm where you are.
Challenge
BeginnerNavigate into the documents folder using the cd command, then print your current location using pwd.
Hint: You can run multiple commands one after another — first
cd, thenpwd.
Cheat sheet
The cd command stands for Change Directory and is used to navigate between folders in the filesystem.
To move into a folder:
cd documentsCommon cd shortcuts:
cd .. — move up one level to the parent directory
cd ~ — go to your home directory
cd / — go to the root directory
cd - — return to the previous directory
Tip: Combine cd with ls and pwd to navigate effectively — list contents, change directories, and confirm your location.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
4Directories
Create A DirectoryCopy A DirectoryMove And Rename A DirectoryDelete A DirectoryRecap - Directory Operations7File Content
Head And TailWord CountSort CommandUnique CommandGrep BasicsGrep With FlagsRecap - Text Detective2Navigation
Print Working DirectoryList FilesChange DirectoryAbsolute vs Relative PathsHome And Root DirectoryRecap - Find Your Way8Redirection
Standard OutputOverwrite To A FileAppend To A FileStandard InputStandard ErrorRecap - Log Builder6Wildcards And Patterns
The Star WildcardThe Question Mark WildcardBracket WildcardsCombining WildcardsRecap - Selective Operations9Piping
What Is A PipeChaining Two CommandsChaining Multiple CommandsPipe With GrepRecap - Data Pipeline