Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is your preferred bash alias server side? client side?

user-image
Question added by R e n z o V i d o n i , Consultant , Various
Date Posted: 2015/09/10
R e n z o V i d o n i
by R e n z o V i d o n i , Consultant , Various

A Bash alias is essentially nothing more than a keyboard shortcut, an abbreviation, a means of avoiding typing a long command sequence.

Source: tldp.org/LDP/abs/html/aliases.html‎

 

Aliases are common in Linux/Unix shells but also in Windows Command Prompt and in PowerShell.

Bash aliases are useful to call a command with some specific options, to run a script / application or to read a personal help file in the shell.

The Bash aliases are in .bashrc (a 'dot' file where define your aliases, functions and other interactive features) but is better create and use a .bash_aliases file.

To read the bash' s aliases simple type alias that displays a list of all current aliases.

 

My preferred are:

 

alias su='su -p'

This invoke the su command (change user ID or become superuser) with the -p option to preserve the current environment.

 

alias rm='rm -iv'

This start rm (remove files or directories) in interactive and verbose mode to avoid to delete files by mistake.

Note that the -f (force) option ignore the interactive option.

 

alias re-source='source ~/.bashrc'

This reload all the bash configuration files.Useful when you modify them, like adding an alias, for the changes to take effect.

 

Ignore the alias with \\\\ or ' ' like: \\\\rm or 'rm'.

This, in Unix shells, override the rm alias.

 

Regards, Renzo

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.