Automatically pulled from Google Starred

$ function md () { mkdir -p "$@" && cd "$@"; }

How often do you make a directory (or series of directories) and then change into it to do whatever? 99% of the time that is what I do.

This BASH function ‘md’ will make the directory path then immediately change to the new directory. By using the ‘mkdir -p’ switch, the intermediate directories are created as well if they do not exist.

commandlinefu.com

by David Winterbottom (codeinthehole.com)

Go to Source

Tags: ,



Leave a Comment

Anti-Spam Protection by WP-SpamFree