Created
April 29, 2017 12:43
-
-
Save victorloux/80fde1c522b2841af55dedab1015f4a8 to your computer and use it in GitHub Desktop.
cd into the most recently created directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this creates the command "cr" which will cd into the most recently created directory | |
# useful after using mkdir, git clone, unzip etc. | |
# no need to type "mkdir new-project && cd new-project" | |
# just "mkdir new-project" then "cr"! | |
# !! WORKS ON macOS only (Linux doesn't have creation times) | |
# but it can surely be adapted with some hack on the modified time | |
alias cr=cd (ls -tUd */ | head -n 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment