2021-04-02 19:06:33 +02:00
|
|
|
# general aliases
|
|
|
|
|
|
|
|
## Alias handling
|
2021-04-16 12:04:30 +02:00
|
|
|
alias editalias='vim $HOME/.config/oh-my-zsh/aliases.zsh'
|
|
|
|
alias updatealias='source $HOME/.zshrc'
|
2021-04-02 19:06:33 +02:00
|
|
|
|
|
|
|
## https://www.atlassian.com/git/tutorials/dotfiles
|
|
|
|
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
|
|
|
|
|
|
|
## navigation
|
|
|
|
alias ..='cd ..'
|
|
|
|
alias ...='cd ../..'
|
|
|
|
|
|
|
|
## 'ls' to 'exa'
|
|
|
|
alias ls='exa -l --color=always --group-directories-first'
|
|
|
|
alias la='exa -al --color=always --group-directories-first'
|
|
|
|
alias ll='exa -l --color=always --group-directories-first'
|
|
|
|
|
|
|
|
## 'grep' to 'rg' -> 'ripgrep'
|
|
|
|
alias grep='rg'
|
|
|
|
|
|
|
|
## 'cat' to 'bat'
|
|
|
|
alias cat='bat'
|
|
|
|
|
|
|
|
## TODO 'delta' instead of 'git diff'
|
|
|
|
|
|
|
|
## confirm before overwriting files
|
|
|
|
alias cp="cp -i"
|
|
|
|
alias mv='mv -i'
|
|
|
|
alias rm='rm -i'
|
|
|
|
|
|
|
|
## adding flags
|
|
|
|
alias df='df -h'
|
|
|
|
alias free='free -m'
|
2021-07-10 17:05:15 +02:00
|
|
|
alias du='du -h -d 2'
|
2021-04-02 19:06:33 +02:00
|
|
|
|
|
|
|
## color and condense ip output
|
|
|
|
alias ipa='ip -br -c addr show'
|
|
|
|
alias ipl='ip -br -c link show'
|
|
|
|
|
2021-04-16 12:04:30 +02:00
|
|
|
## get parent and child processes for a given name
|
|
|
|
function psgrep {
|
|
|
|
ps axuf | grep -v grep | grep "$@" -i --color=auto;
|
|
|
|
}
|
|
|
|
|
2021-05-23 10:23:44 +02:00
|
|
|
## check active hosts on subnet
|
|
|
|
function getActiveHosts {
|
|
|
|
nmap -sP $(ip route | awk '/src/ {print $1}');
|
|
|
|
}
|
|
|
|
|
|
|
|
## always spawn new window for firefox
|
|
|
|
alias firefox='firefox --new-window'
|
|
|
|
|