Skip to content

Instantly share code, notes, and snippets.

@HR
Created June 4, 2017 11:29
Show Gist options
  • Save HR/c88a23ffb9232bb4147b4a6c0c1b53a8 to your computer and use it in GitHub Desktop.
Save HR/c88a23ffb9232bb4147b4a6c0c1b53a8 to your computer and use it in GitHub Desktop.
Useful bash utility functions
# FileSearch
function f() { find . -iname "*$1*" ${@:2} }
# File removal by name
function frm() { find . -iname "*$1*" -print0 | xargs -0 rm -r }
# File content search
function fr() { grep "$1" ${@:2} -R . }
# mkdir and cd
function mkcd() { mkdir -p "$@" && cd "$_"; }
# add commit and push all change instantly
function gacop() {
git add -A
git commit -am $1
git push
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment