Difference between revisions of "Bash: alias"

From wikieduonline
Jump to navigation Jump to search
 
(99 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
<code>alias</code> 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" <ref>https://www.gnu.org/software/bash/manual/bash.html#Aliases</ref>
  
 +
== Examples ==
 +
* Execute <code>alias</code> to display your aliases
  
alias does not accept parameters but a function can be called just like an alias
+
touch [[~/.bash_aliases]]
  
 +
 +
== Related terms ==
 +
* [[Shell functions]]
 +
* <code>[[ifconfig]]</code> and [[IP]] alias address
 +
* <code>[[.bashrc and .bash profile]]</code>
 +
* <code>[[source]]</code>
 +
* <code>[[aws list all]]</code>
 +
* <code>[[suaws]]</code> [[Bash shell functions|function]]
 +
* <code>[[.zprofile]]</code>
 +
* <code>[[viprofile]]</code>
 +
* [[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 ==
 +
* {{alias}}
 
* {{bash}}
 
* {{bash}}
  
 
[[Category:Bash]]
 
[[Category:Bash]]
 +
[[Category:Linux commands]]

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: