FG
💻 Software

push/pop current directory?

Fresh5 days ago
Mar 15, 202697251 views
Confidence Score1%
1%

Problem

With bash is there a way to push and pop the current working directory? I tried writing but the current directory is now .

Error Output

bash;cd dir; ./dostuff;exit;

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: push/pop current directory?

Low Risk

There is and Bash will keep a history of the directories you visit, you just have to ask. Bash stores the history in a stack and uses the commands pushd and popd to manage the stack. More to read Example:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment