Skip to content

Instantly share code, notes, and snippets.

@multiplemonomials
Last active May 7, 2018 09:34
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 multiplemonomials/d9d41c16b48a702d8bd6 to your computer and use it in GitHub Desktop.
Save multiplemonomials/d9d41c16b48a702d8bd6 to your computer and use it in GitHub Desktop.
Bash/Zsh rc file functions to make life easier
#options that you always want but are not the default for some reason
alias rm='rm -rf'
alias cp='cp -a'
alias mkdir='mkdir -p'
alias fgrep='grep -RIn'
# disable Oh My Zsh history sharing
unsetopt share_history
# get list of all CMake scripts in a folder
function allcmake() {
find $1 -name 'CMakeLists.txt' -or -name '*.cmake'
}
#create directory and enter it
function xkcd() {
mkdir $1
cd $1
}
#add execute permission to something and run it
function execute() {
chmod +x $1
./$1
}
#finally, a mount that doesn't taunt you with
#wah wah wah, "only root can do that" and "the mount point doesn't exist"
function jmount() {
sudo mkdir ${@: -1}
sudo mount $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment