dotfiles/.zsh/lib/20-aliases.zsh

41 lines
1.2 KiB
Bash
Raw Normal View History

2020-05-23 10:10:24 +02:00
_exists() { (( $+commands[$1] )) }
2020-06-09 21:17:38 +02:00
_exists less && export PAGER=less
2020-05-23 10:10:24 +02:00
if _exists vim; then
2020-06-09 21:17:38 +02:00
export EDITOR=vim
alias vim="vim -p"
2020-05-23 10:10:24 +02:00
fi
unfunction _exists
alias ls='ls --color=always -h'
2020-06-09 21:17:38 +02:00
alias ll='ls -lah'
alias mkdir='mkdir -p'
2016-04-16 16:31:54 +02:00
alias ...='cd ../..'
alias foldersize='du -sh'
2019-04-19 23:54:46 +02:00
alias duf='du -sk * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done'
2020-06-02 15:59:14 +02:00
alias google='ping -c 10240000 google.com'
case `uname` in
Darwin)
# commands for OS X go here
alias flushdns='dscacheutil -flushcache && killall -HUP mDNSResponder'
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
alias r='open -a'
2020-05-22 23:31:04 +02:00
alias ydl="youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'"
alias nmap_localnet='nmap -sP 10.0.3.0/24'
2020-06-09 21:17:38 +02:00
alias fetch='curl -O'
2020-06-29 23:19:36 +02:00
alias htop='sudo htop'
alias sulast='sudo $(history -p !-1)'
;;
Linux)
# commands for Linux go here
;;
FreeBSD)
# commands for FreeBSD go here
2020-06-02 15:59:14 +02:00
alias stl="sockstat -l"
2020-06-29 23:19:36 +02:00
alias sulast='doas $(history -p !-1)'
;;
esac