Alias simplifies complex command strings so that a single word or a simplified command can implement complex (usually long strings with many parameters) commands.
Basic usage:
Alias Simplify command = ' actual long string command '//actual long string command usually ' original command-/option parameter '
eg. Alias Ll= ' Ls-a '
Get aliases:
Alias//To view all alias aliases currently set
To cancel an alias:
Unalias Simplify commands
eg. Unalias ll//Cancel the LL alias
Permanent entry into force:
Aliases defined directly using the alias command are invalidated after a reboot. So if you need to use aliases permanently, you need to do something about it.
modifying/defining aliases is actually the environment variable that defines the system.
The system environment variable file is/etc/profile.
But looking at the profile file, you'll notice that the file starts with a hint:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/83/4A/wKiom1dveW3iD8cAAABmydfpoWk279.png "title=" Alias.png "alt=" Wkiom1dvew3id8caaabmydfpowk279.png "/>
It is therefore better not to define directly in the/etc/profile file, but to define it in/ETC/BASHRC, and after the definition is complete, make it effective by #source/ETC/BASHRC.
Or, redefine a file/etc/profile.d/alias_bash.sh (Alias_bash file name is arbitrary), and then make it effective by #source/etc/profile.d/alias_bash.
This way, you can make your own (custom) aliases permanent.
Commonly used alias command strings (according to their own habits are very different):
Alias du1= ' du-h--max-depth=1 '//View primary directory usage size (space occupied)
Alias du2= ' du-h--max-depth=2 '//View secondary directory usage size (space occupied)
Alias grep= ' grep--color=auto '//When using grep filtering, highlight filtered characters with default color (string)
(to be added)
Make Alias customizations permanent (+ common aliases) under Linux CentOS