Difference between revisions of "Bash: alias"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
 
* Execute <code>alias</code> to display your aliases
 
* Execute <code>alias</code> to display your aliases
  
  touch [[~/.bash_alias]]
+
  touch [[~/.bash_aliases]]
  
alias x="[[exit]]"
 
 
alias mp="[[multipass (command)|multipass]]"
 
 
[[set -o vi]]
 
 
alias [[soniq]]="[[sort]] | [[uniq]]"
 
 
 
alias [[trim]]="awk ' {\$1=\$1} 1 '"
 
 
[[source]] <([[kubectl completion zsh]])
 
[[source]] <([[k9s completion zsh]])
 
 
alias k="kubectl"
 
alias kgn="kubectl get nodes"
 
alias kgp="kubectl get pods"
 
alias kgd="kubectl get deploy"
 
alias kgs="kubectl get sts"
 
alias kgpvc="kubectl get pvc"
 
 
[[export]] [[do]]="[[-o yaml]] [[--dry-run]]=client"
 
alias [[vikubeconfig]]="vi [[~/.kube/config]]"
 
alias catkubeconfig="cat [[~/.kube/config]]"
 
 
alias tf="[[terraform]]"
 
alias tg="[[terragrunt]]"
 
 
alias g="grep"
 
alias gi="grep -i"
 
alias gir="grep -i"
 
alias gv="grep -v"
 
alias agir="ag -ir"
 
 
alias la="ls -la"
 
 
alias NF="awk '{print \$NF}'"
 
 
alias viprofile="vi ~/.bash/profile"
 
alias [[srcprofile]]="[[source]] ~/[[.bash_profile]]"
 
alias [[sourceprofile]]="[[source]] ~/[[.bash_profile]]"
 
alias [[zsourceprofile]]="source ~/[[.zprofile]]"
 
alias vizprofile="vi ~/.zprofile"
 
 
alias p8="ping 8.8.8.8"
 
 
alias [[bip]]="while true; do [[tput bel]]; sleep 1; done"
 
 
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"
 
 
 
alias [[viconfig]]="vi ~/[[.ssh/config]]"
 
alias [[visshconfig]]="vi ~/[[.ssh/config]]"
 
alias [[viawsconfig]]="vi ~/[[.aws/config]]"
 
alias [[viawscredentials]]="vi ~/[[.aws/credentials]]"
 
 
alias [[awswhoiam]]="[[aws iam get-user]]"
 
 
alias viprofile="vi ~/.bash_profile"
 
alias vizprofile="vi ~/.zprofile"
 
#[[viprofile]] () { vi ~/.bash_profile }
 
 
alias codecode="sed s/'^'/'\<code\>'/ | sed s/'$'/'\<\/code\>'/"
 
 
prepend_space () {
 
          sed s/^/" "/
 
}
 
 
alias [[bi]]="brew install"
 
  
 
== Related terms ==
 
== Related terms ==

Latest revision as of 09:25, 13 February 2024

alias does not accept parameters but a function can be called just like an alias, according to official documentation "for almost every purpose, shell functions are preferred over aliases" [1]

Examples[edit]

  • Execute alias to display your aliases
touch ~/.bash_aliases


Related terms[edit]

See also[edit]

  • https://www.gnu.org/software/bash/manual/bash.html#Aliases
  • Advertising: