In Linux, you often need to switch directories, Which is troublesome. Then you think of the alias command, which can be used to convert a long command into a short command that we like. sort out the usage of this command for future convenience.
Function Description: sets the alias of an instruction.
Syntax: alias [alias] = [command name]
Parameter: If no parameter is added, all alias settings are listed.
For example:
Root @ czu :~ /Projects/myshell/srce # alias
Alias begin = 'mount-t vmhgfs. host: // mnt/hgfs /'
Alias egrep = 'egrep -- color = auto'
Alias fgrep = 'fgrep -- color = auto'
Alias gopj = 'CD/root/Project'
Alias grep = 'grep -- color = auto'
Alias l = 'LS-CF'
Alias la = 'LS-'
Alias ll = 'LS-alf'
Alias ls = 'ls -- color = auto'
Alias work = 'CD/mnt/hgfs/vmwarefolder'
Note: You can use alias to customize the alias of a command. if you only enter alias, all current alias settings can be listed. the role of alias is limited to the login operation. if you want to automatically set an alias for each login, you can go to/etc/profile or your own ~ /. Set the alias of the command in bashrc.
Also, if you want to apply an alias to each user, add the alias to the end of/etc/bashrc. bashrc is the configuration file of environment variables./etc/bashrc and ~ /. The difference between bashrc and bashrc is that it is set for all systems to be set for individual users.
To take effect permanently, write this entry to/etc/bashrc.
Detailed description of alias commands in Linux
Linux Command alias/unalias
Usage of alias in Ubuntu
Practical application of Linux/shell commands -- added custom commands in alias
Linux alias command parameters and usage-Linux definition command alias
General problems of alias in Ubuntu