Skip to content

Instantly share code, notes, and snippets.

@llagerlof
Last active August 29, 2022 13:00
Show Gist options
  • Save llagerlof/3a4e76774ad241afdd0d6afc8338511e to your computer and use it in GitHub Desktop.
Save llagerlof/3a4e76774ad241afdd0d6afc8338511e to your computer and use it in GitHub Desktop.
Create a directory, copy the full path to the clipboards and enter the directory
# Paste this function into your ~/.bashrc
# Before use, install the xclip package of your distro, if isn't installed yet.
# Create a directory, copy the full path to the clipboards and enter the directory
md() {
mkdir "$1" || return 1
realpath "$1" | tr -d '\n' | xclip -selection clipboard
realpath "$1" | tr -d '\n' | xclip
cd "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment