Set up a temporary alias
alias ll="ls -al"
The disadvantage is that the next time you log does not take effect
Permanent solution
Etc into the folder
cd /etc/
Create a file bash_aliases
vim bash_aliases
Fill in the alias command, if necessary, you can fill in your own command aliases
alias gohome="cd ~"
alias ll="ls -al"
Press ESC
Enter :wq
to save the file
Modify bash.bashrc file
vim /etc/bash.bashrc
Move the cursor to the bottom paste the code below ( Reference Bowen )
if [ -f /etc/bash_aliases ]; then
. /etc/bash_aliases
fi
Press ESC
Enter :wq
to save the file
Execute source ~/.bashrc
immediate effect
If you do not become effective
execution reboot
restart (Note: The server should not arbitrarily executed)
re-register
C:\Users\admin>ssh [email protected]
[email protected]'s password:
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-52-generic x86_64)
Input ll
display
root@iZs9kgd0x5xmhaZ:~# ll
total 108
drwx------ 14 root root 4096 Jul 22 16:13 .
drwxr-xr-x 22 root root 4096 Jul 22 13:59 ..
drwxr-xr-x 3 root root 4096 Jul 18 10:25 .aspnet
-rw------- 1 root root 6241 Jul 22 16:13 .bash_history
-rw-r--r-- 1 root root 83 Jul 22 14:25 .bash_profile
Reference article: