2011-06-01 08:48:26 +02:00
|
|
|
function history-stat() {
|
2009-09-01 00:00:15 +02:00
|
|
|
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
|
2009-09-01 00:00:38 +02:00
|
|
|
}
|
|
|
|
|
2011-06-01 08:48:26 +02:00
|
|
|
function mkdcd() {
|
|
|
|
mkdir -p "$1"
|
|
|
|
cd "$1"
|
2009-08-31 15:03:56 +02:00
|
|
|
}
|
2010-12-24 23:20:57 +01:00
|
|
|
|
2011-05-31 00:39:04 +02: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
|
|
|
|
}
|
|
|
|
|
2011-06-01 08:48:26 +02:00
|
|
|
function gown() {
|
|
|
|
sudo chown -R "${USER}" "${1:-.}"
|
2011-05-31 00:39:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function reload() {
|
2011-06-01 08:48:26 +02:00
|
|
|
local zshrc="$HOME/.zshrc"
|
|
|
|
if [[ -n "$1" ]]; then
|
|
|
|
zshrc="$1"
|
|
|
|
fi
|
|
|
|
source "$zshrc"
|
2011-05-31 00:39:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function calc() {
|
|
|
|
echo "scale=4; $@" | bc -l
|
|
|
|
}
|
|
|
|
|
|
|
|
function pmine() {
|
2011-06-01 08:48:26 +02:00
|
|
|
ps "$@" -u "$USER" -o pid,%cpu,%mem,command
|
2011-05-31 00:39:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function findexec() {
|
2011-06-01 08:48:26 +02:00
|
|
|
find . -type f -iname "*${1:-}*" -exec "${2:-file}" {} \;
|
2011-05-31 00:39:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function httpserve() {
|
2011-06-01 08:48:26 +02:00
|
|
|
python -m SimpleHTTPServer "$@"
|
2011-05-31 00:39:04 +02:00
|
|
|
}
|
|
|
|
|