Skip to content

Instantly share code, notes, and snippets.

@oxagast
Created March 27, 2024 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxagast/7cd7696825d9d07a6df0c13b714170a0 to your computer and use it in GitHub Desktop.
Save oxagast/7cd7696825d9d07a6df0c13b714170a0 to your computer and use it in GitHub Desktop.
What was I doing again? A alias that helps you remember where you left off working.
# zsh function alias that helps you remember where you left off working in a directory.
# useage: leftoff /etc
leftoff() { e=$(pwd);cd $1; IFS=$'\n' d=($(ls -t -1 $(pwd) | head -n 5));for a in ${d}; do c=$(ls -t ${a} | head -n 1); echo "${a}/${c}"; done;cd ${e} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment