How to return to the previous directory?

QuestionsQuestions8 SkillsProYour First Linux LabSep, 12 2025
0158

To return to the previous directory in Linux, you can use the cd command with a dash (-). Here’s how to do it:

cd -

This command will take you back to the directory you were in before your last cd command. After executing this command, you can verify your current directory by using:

pwd

This will display the path of the directory you have returned to.

0 Comments

no data
Be the first to share your comment!