Difference between revisions of "Aliases in .bashrc"

Make more generic and update obsolete commands
imported>DeMus
imported>Dalto
(Make more generic and update obsolete commands)
Line 7: Line 7:
An '''alias''' is a ''substitute for a (complete) command''. It can be thought of as a shortcut.
An '''alias''' is a ''substitute for a (complete) command''. It can be thought of as a shortcut.


'''.bashrc''' is found in the ''home folder'' of a user ( ~ ) . It is a hidden file, to see it enable "Show Hidden Files".
'''.bashrc''' is found in the ''home folder'' of a user ( ~ ) . It is a hidden file, to see it show hidden files in your file manager or use '''ls -a'''
 
A shorcut for that is <Ctrl + H> in XFCE.


== Backup your current .bashrc ==
== Backup your current .bashrc ==


It is handy to backup the ~/.bashrc before editing it, as it allows one to be able to easily recover from the unexpected.
It can be useful to backup the ~/.bashrc before editing it, as it allows one to be able to easily recover from the unexpected.


To make a backup of your current .bashrc . Open a terminal and type -
To make a backup of your current .bashrc . Open a terminal and type -
Line 25: Line 23:
== Note ==
== Note ==


Any changes made to the .bashrc will have no effect on any currently open Terminal windows. After shutting an open Terminal window down & then restarting it, one can then test out their alias(s).
Any changes made to the .bashrc will have no effect on any currently open terminal windows. To test newly updated changes in your .bashrc open a new terminal or use the command:
 
Or for a quicker way, after having modified the ~/.bashrc run the following command:


  source .bashrc
  source .bashrc


To reload the configuration file.
== Aliases Examples ==
 
== Aliases ==


Aliases can turn a complex command string into a simple custom made command that one can type in the Terminal.  
Aliases can turn a complex command string into a simple custom made command that one can type in the Terminal.  
Line 48: Line 42:




To upgrade packages installed from the AUR via yaourt, the command used is '''''yaourt -Syu --aur'''''
To upgrade packages installed from the AUR via yay, the command used is '''''yay -Syu --aur'''''


This can be aliased with-
This can be aliased with-


  alias aup="yaourt -Syu --aur"  
  alias aup="yay -Syu --aur"  




Line 81: Line 75:
== Conclusion ==
== Conclusion ==


This list is not comprehensive. A user can add many aliases that (s)he commonly uses.
This list is not comprehensive. Almost anything that is commonly used can be shortened with an alias
 
 
== Support ==
 
Following is a link to this page's forum counterpart where you can post any related feedback and get more information about aliases: [https://forum.manjaro.org/index.php?topic=14608.0]




Credits go to Handy for his .bashrc guide.
== See Also ==
[https://www.gnu.org/software/bash/manual/html_node/index.html Bash documentation]




[[Category:Contents Page]]
[[Category:Contents Page]]
Anonymous user