Last active
May 7, 2018 09:34
-
-
Save multiplemonomials/d9d41c16b48a702d8bd6 to your computer and use it in GitHub Desktop.
Bash/Zsh rc file functions to make life easier
This file contains hidden or 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
#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