Is there a shortcut to mkdir foo and immediately cd into it?
Problem
This is something I do frequently This works as a single command, but it's more keystrokes and saves no time. Is there a shortcut for this? Edit With the use of help below, this seems to be the most elegant answer.
Error Output
$ mkdir foo $ cd foo
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: Is there a shortcut to mkdir foo and immediately cd into it?
The , Shells If you don't want another function to remember and don't mind bashisms: The (dollar underscore) bash command variable contains the most recent parameter. So if a user were to type the following at the command line: , then the output would be as follows: The Shell In the fish shell, I would type the following: The alt key combined with either the up or the down arrow key will cycle through command parameter history.
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix