1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-10-31 23:11:13 +00:00
prezto/functions/utility.zsh

61 lines
839 B
Bash
Raw Normal View History

function history-stat() {
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
2009-08-31 22:00:38 +00:00
}
function mkdcd() {
mkdir -p "$1"
cd "$1"
2009-08-31 13:03:56 +00:00
}
function cdll() {
if [[ -n "$1" ]]; then
builtin cd "$1"
ls -lFhA
else
ls -lFhA
fi
}
function pushdll() {
if [[ -n "$1" ]]; then
builtin pushd "$1"
ls -lFhA
else
ls -lFhA
fi
}
function popdll() {
builtin popd
ls -lFhA
}
function gown() {
sudo chown -R "${USER}" "${1:-.}"
}
function reload() {
local zshrc="$HOME/.zshrc"
if [[ -n "$1" ]]; then
zshrc="$1"
fi
source "$zshrc"
}
function calc() {
echo "scale=4; $@" | bc -l
}
function pmine() {
ps "$@" -u "$USER" -o pid,%cpu,%mem,command
}
function findexec() {
find . -type f -iname "*${1:-}*" -exec "${2:-file}" {} \;
}
function httpserve() {
python -m SimpleHTTPServer "$@"
}