Command: Alias ll= "Ls-l"
However, this command will be lost after logging back in
It can be saved in the. bashrc file in the user directory, but will not take effect until the user logs back in, and be careful not to return or use source ~/. BASHRC(or. ~/. BASHRC) make changes effective immediately
. bashrc File
. BASHRC -The individual Per-interactive-shell startup file.
This file mainly preserves some personal personalization settings, such as command aliases, paths, and so on. Here's an example:
# User specific aliases and functions
Path= "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
Lang=zh_cn. GBK
Export PATH LANG
Alias rm= ' Rm-i '
Alias ls= '/bin/ls-f--color=tty--show-control-chars '
The example defines the path, language, command alias (always with the-I parameter when using RM Delete command requires user confirmation, and the LS command lists the file list with color display).
After each modification . BASHRC , use the source ~/. BASHRC(or. ~/. BASHRC) can immediately load the modified settings to make it effective.
The . BASHRCis typically called explicitly in the. bash_profile file. When you log in to Linux to start bash, you will first read the ~/.bash_profile file, so that ~/. BASHRC will be executed, and your personalization will take effect.
Alias settings under Linux