Difference between revisions of "~/.bash aliases"
Jump to navigation
Jump to search
(29 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | # Profile Bash | |
+ | alias viprofile="vi ~/.bash/profile" | ||
+ | alias vialiases="vi ~/.bash/.bash_aliases" | ||
+ | alias [[srcprofile]]="[[source]] ~/[[.bash_profile]]" | ||
+ | alias [[srcaliases]]="[[source]] ~/[[.bash_aliases]]" | ||
+ | alias [[sourceprofile]]="[[source]] ~/[[.bash_profile]]" | ||
+ | alias [[zsourceprofile]]="source ~/[[.zprofile]]" | ||
+ | alias vizprofile="vi ~/.zprofile" | ||
+ | |||
+ | # tools | ||
alias x="[[exit]]" | alias x="[[exit]]" | ||
− | |||
− | |||
− | |||
alias [[soniq]]="[[sort]] | [[uniq]]" | alias [[soniq]]="[[sort]] | [[uniq]]" | ||
− | + | alias [[bi]]="brew install" | |
− | alias [[ | + | |
− | + | # Kubernetes | |
− | |||
− | |||
− | |||
alias k="kubectl" | alias k="kubectl" | ||
+ | alias kg="kubectl get" | ||
alias kgn="kubectl get nodes" | alias kgn="kubectl get nodes" | ||
alias kgp="kubectl get pods" | alias kgp="kubectl get pods" | ||
alias kgd="kubectl get deploy" | alias kgd="kubectl get deploy" | ||
alias kgs="kubectl get sts" | alias kgs="kubectl get sts" | ||
+ | alias kgi="kubectl get ingress" | ||
alias kgpvc="kubectl get pvc" | alias kgpvc="kubectl get pvc" | ||
− | + | alias kdi="[[kubectl describe ingress]]" | |
+ | alias [[vikubeconfig]]="vi [[~/.kube/config]]" | ||
+ | alias [[catkubeconfig]]="cat [[~/.kube/config]]" | ||
+ | |||
[[export]] [[do]]="[[-o yaml]] [[--dry-run]]=client" | [[export]] [[do]]="[[-o yaml]] [[--dry-run]]=client" | ||
− | alias [[ | + | |
− | alias | + | # Vi |
− | + | alias [[cathost]]="sudo cat [[/etc/hosts]]" | |
+ | alias [[vihost]]="sudo cat [[/etc/hosts]]" | ||
+ | |||
+ | alias [[catetchost]]="sudo cat [[/etc/hosts]]" | ||
+ | alias [[vietchost]]="sudo cat [[/etc/hosts]]" | ||
+ | |||
+ | # Terraform | ||
alias tf="[[terraform]]" | alias tf="[[terraform]]" | ||
alias tg="[[terragrunt]]" | alias tg="[[terragrunt]]" | ||
− | + | ||
+ | # Grep | ||
alias g="grep" | alias g="grep" | ||
alias gi="grep -i" | alias gi="grep -i" | ||
Line 30: | Line 45: | ||
alias gv="grep -v" | alias gv="grep -v" | ||
alias agir="ag -ir" | alias agir="ag -ir" | ||
− | + | #--exclude-dir='.*' | |
+ | |||
alias la="ls -la" | alias la="ls -la" | ||
− | + | ||
alias NF="awk '{print \$NF}'" | alias NF="awk '{print \$NF}'" | ||
− | + | ||
− | + | # Net | |
− | + | alias [[p8]]="ping 8.8.8.8" | |
− | alias [[ | + | alias [[p1]]="ping [[1.1.1.1]]" |
− | + | ||
− | + | # MULTIPASS | |
− | |||
− | |||
− | |||
− | |||
− | alias [[ | ||
− | |||
alias mp="[[multipass]]" | alias mp="[[multipass]]" | ||
alias mp_l="[[multipass list]]" | alias mp_l="[[multipass list]]" | ||
Line 54: | Line 64: | ||
alias mpc="multipass connect" | alias mpc="multipass connect" | ||
− | + | # SSH | |
alias [[viconfig]]="vi ~/[[.ssh/config]]" | alias [[viconfig]]="vi ~/[[.ssh/config]]" | ||
alias [[visshconfig]]="vi ~/[[.ssh/config]]" | alias [[visshconfig]]="vi ~/[[.ssh/config]]" | ||
+ | |||
+ | # AWS | ||
alias [[viawsconfig]]="vi ~/[[.aws/config]]" | alias [[viawsconfig]]="vi ~/[[.aws/config]]" | ||
alias [[viawscredentials]]="vi ~/[[.aws/credentials]]" | alias [[viawscredentials]]="vi ~/[[.aws/credentials]]" | ||
− | + | alias [[catawsconfig]]="cat ~/[[.aws/config]]" | |
+ | alias [[catawscredentials]]="cat ~/[[.aws/credentials]]" | ||
alias [[awswhoiam]]="[[aws iam get-user]]" | alias [[awswhoiam]]="[[aws iam get-user]]" | ||
+ | #alias [[aws-all-regions]] | ||
+ | |||
+ | # REVIEW | ||
+ | alias [[bip]]="while true; do [[tput bel]]; sleep 1; done" | ||
− | |||
− | |||
− | |||
alias codecode="sed s/'^'/'\<code\>'/ | sed s/'$'/'\<\/code\>'/" | alias codecode="sed s/'^'/'\<code\>'/ | sed s/'$'/'\<\/code\>'/" | ||
Line 72: | Line 86: | ||
} | } | ||
− | alias [[ | + | alias [[trim]]="awk ' {\$1=\$1} 1 '" |
+ | |||
+ | [[source]] <([[kubectl completion zsh]]) | ||
+ | [[source]] <([[k9s completion zsh]]) | ||
− | + | == Related == | |
+ | * <code>[[~/.bash_profile]]</code> | ||
+ | * [[~/.config/fish/config.fish]] | ||
+ | * [[source ~/.bash_aliases]] | ||
== See also == | == See also == | ||
+ | * {{Alias}} | ||
* {{Bash}} | * {{Bash}} | ||
[[Category:Bash]] | [[Category:Bash]] |
Latest revision as of 10:58, 22 August 2024
# Profile Bash alias viprofile="vi ~/.bash/profile" alias vialiases="vi ~/.bash/.bash_aliases" alias srcprofile="source ~/.bash_profile" alias srcaliases="source ~/.bash_aliases" alias sourceprofile="source ~/.bash_profile" alias zsourceprofile="source ~/.zprofile" alias vizprofile="vi ~/.zprofile" # tools alias x="exit" alias soniq="sort | uniq" alias bi="brew install" # Kubernetes alias k="kubectl" alias kg="kubectl get" alias kgn="kubectl get nodes" alias kgp="kubectl get pods" alias kgd="kubectl get deploy" alias kgs="kubectl get sts" alias kgi="kubectl get ingress" alias kgpvc="kubectl get pvc" alias kdi="kubectl describe ingress" alias vikubeconfig="vi ~/.kube/config" alias catkubeconfig="cat ~/.kube/config" export do="-o yaml --dry-run=client" # Vi alias cathost="sudo cat /etc/hosts" alias vihost="sudo cat /etc/hosts" alias catetchost="sudo cat /etc/hosts" alias vietchost="sudo cat /etc/hosts" # Terraform alias tf="terraform" alias tg="terragrunt"
# Grep alias g="grep" alias gi="grep -i" alias gir="grep -i" alias gv="grep -v" alias agir="ag -ir" #--exclude-dir='.*' alias la="ls -la" alias NF="awk '{print \$NF}'" # Net alias p8="ping 8.8.8.8" alias p1="ping 1.1.1.1" # MULTIPASS alias mp="multipass" alias mp_l="multipass list" alias mp_la="multipass launch" alias mp_launch="multipass launch" alias mp_find="multipass find" alias mp_f="multipass find" alias mpc="multipass connect"
# SSH alias viconfig="vi ~/.ssh/config" alias visshconfig="vi ~/.ssh/config"
# AWS alias viawsconfig="vi ~/.aws/config" alias viawscredentials="vi ~/.aws/credentials" alias catawsconfig="cat ~/.aws/config" alias catawscredentials="cat ~/.aws/credentials" alias awswhoiam="aws iam get-user" #alias aws-all-regions
# REVIEW alias bip="while true; do tput bel; sleep 1; done"
alias codecode="sed s/'^'/'\<code\>'/ | sed s/'$'/'\<\/code\>'/"
prepend_space () { sed s/^/" "/ }
alias trim="awk ' {\$1=\$1} 1 '"
source <(kubectl completion zsh) source <(k9s completion zsh)
Related[edit]
See also[edit]
alias
, Bash: alias:viconfig, bip, .bash_aliases
Bash [ -c ]
,alias
,&&
, Bash history, Autocompletion,set
,unset
,export
,.bash_aliases, .bashrc and .bash profile
,PS1
,echo
,brace expansion
, Function,shopt
,trap
,set -e
,source
,PATH
,complete
,disown
,.hushlogin
,.bashrc
,builtin
,eval
,set
,$PATH
,$HOME
,TZ
,.profile
,-e, -i
,Builtin (Bash)
,mapfile
,~
, return (Bash), for, until,declare, dirname, basename, functions.sh
, Bash arithmetic expansion,shift, bash --rcfile, readonly, $1, $@
Advertising: