Difference between revisions of "Bash: alias"
Jump to navigation
Jump to search
↑ https://www.gnu.org/software/bash/manual/bash.html#Aliases
(45 intermediate revisions by 6 users not shown) | |||
Line 4: | Line 4: | ||
* Execute <code>alias</code> to display your aliases | * Execute <code>alias</code> to display your aliases | ||
− | + | touch [[~/.bash_aliases]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Related terms == | == Related terms == | ||
Line 51: | Line 17: | ||
* <code>[[viprofile]]</code> | * <code>[[viprofile]]</code> | ||
* [[Append a space]] | * [[Append a space]] | ||
+ | * <code>[[bash]]: [[compdef]]: [[command not found]]</code> | ||
+ | * <code>[[shopt -s expand_aliases]]</code> | ||
+ | * <code>[[export -f]]</code> | ||
+ | * <code> sed s/'^'/'\<code\>'/ | sed s/'$'/'\<\/code\>'/ </code> | ||
== See also == | == See also == |
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]
- Shell functions
ifconfig
and IP alias address.bashrc and .bash profile
source
aws list all
suaws
function.zprofile
viprofile
- Append a space
bash: compdef: command not found
shopt -s expand_aliases
export -f
sed s/'^'/'\<code\>'/ | sed s/'$'/'\<\/code\>'/
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: