We can modify the/etc/bash. bashrc file (other users are in their respective directories) so that we can automatically load our custom commands when logging on to shell.
In the process of using linux, it is inevitable that a long string of commands will be bored if they are frequently typed ......
When calling some executable files, you have to write down a long string of parameters ......
We can modify the/etc/bash. bashrc file (other users are in their respective directories) so that we can automatically load our custom commands when logging on to shell.
For example:
My code directory is/home/ln/code/test/. I want to switch to this path every time I enter mycode in any path.
In the figure, I added alias mycode = 'CD/home/ln/code/test' to bash.
For example, if I often need to capture packets, the command line is as follows:
Capture packets with IP address 192.168.91.128 port 22, 80, and 8048
Tcpdump-I any host 192.168.1.123 and! Port 22 and! Port 80 and! Port 8048-w/opt/temp. cap
You can add the above command to the file using alias ...... Time-saving to improve efficiency