Linux ll is not a command provided by the linux system. It is usually the command alias we set. Generally, the ls -l command is set to ll.
For example, open a terminal window and type the following command:
➜ ~ alias | grep "ll="
ggpull='git pull origin "$(git_current_branch)"'
gstall='git stash --all'
# Since I am using the zsh shell environment
# (use: echo $SHELL), many aliases are configured
# by default, so I use grep to filter it.
You will find my linux ll alias command is: ls -lh
So how to set the command alias?
There are two ways:
One is to use the alias command;
One is to modify the shell configuration file;
The first method can only take effect in the current terminal window. It is invalid in other windows and is automatically lost when closed.
The second method can be permanent and effective in the terminal window.
Next, let’s introduce how to use the above two methods to set aliases?
For example, we want to set up such an alias:
use the alias command
We open a new terminal window and type in the alias dw, the following information will be displayed:
➜ ~ dw
zsh: command not found: dw
This is correct. Because the system does not provide this command and has not configured this alias.
Below we use alias to configure aliases and cancel aliases.
alias set aliasName=‘commands’
First, open a terminal and type the following commands:
➜ ~ alias set dw='cd ~/Downloads/'
Then execute the alias and grep commands to see if they are successful: