Skip to content

Instantly share code, notes, and snippets.

@junkdog
Forked from vrutberg/.profile
Last active August 29, 2015 13:56
Show Gist options
  • Save junkdog/9207104 to your computer and use it in GitHub Desktop.
Save junkdog/9207104 to your computer and use it in GitHub Desktop.
# searches pom.xml files for $1 - skip target folders
alias poms="find . -name pom.xml -and -not -path '*/target/*' -print0 | xargs -0 fgrep -n --color=auto $1"
# copies the output of the last command to the clipboard
copylast() {
fc -s | pbcopy
}
# will show you how many commits there are that matches $1
numcommits() {
git log --grep "$1" --oneline | wc -l
}
# find the first file matching $1 and copy its path to the clipboard
findcp() {
file=$(find $PWD -name "$1" | head -n 1)
echo "$file"
echo "$file" | tr -d "\n" | pbcopy
}
# recursive ls sorted by time of last modification
alias lstimesorted='find . -type f -printf "%-.22T+ %M %n %-8u %-8g %8s %Tx %.8TX %p\n" | sort | cut -f 2- -d " "'
# filter work folders
alias grepsrc="grep -vE '(target|javadoc|work|dist|eclipse-build|\.git)/'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment