Difference between revisions of "Bash: alias"
Jump to navigation
Jump to search
↑ https://www.gnu.org/software/bash/manual/bash.html#Aliases
Line 39: | Line 39: | ||
* <code>[[suaws]]</code> alias | * <code>[[suaws]]</code> alias | ||
* <code>[[.zprofile]]</code> | * <code>[[.zprofile]]</code> | ||
+ | * <code>[[viprofile]]</code> | ||
== See also == | == See also == |
Revision as of 17:16, 24 June 2022
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
- Execute
alias
to display your aliases
alias trim="awk ' {\$1=\$1} 1 '" alias g="grep" alias gi="grep -i" alias gv="grep -v"
alias la="ls -la"
alias NF="awk '{print \$NF}'"
alias sourceprofile="source ~/.bash_profile" alias zsourceprofile="source .zprofile"
alias p8="ping 8.8.8.8"
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 viconfig="vi ~/.ssh/config" alias awswhoiam="aws iam get-user"
Related terms
- shell functions
ifconfig
and IP alias address.bashrc and .bash profile
source
aws list all
suaws
alias.zprofile
viprofile
See also
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: