Bytes --------------------------------------------------------------------------------------------------------
I. History commands
History # view History commands
History-C # Clear history commands
History-W # exit without waiting. directly write the history commands in the cache to the history command to save the file ~ /. Bash_history
Vim/etc/profile # The default history command saves 1000 records. You can modify the histsize to save the number of records (unlimited). The command is saved in ~ /. Bash_history File
Call Of History commands:
1. Call up and down arrows
2 .! N # Run the command whose line number is N. The command displayed in History displays the corresponding line number before it.
3 .! His # execute the last command starting with his
Command and file completion: Tab
[Email protected] Black Eye poet <www. chenwei. ws> ----------------------------------
Ii. aliases and shortcut keys
Alias Vi = "Vim" # defines the alias, which takes effect temporarily
Alias # view all aliases
Command Execution sequence:
First, use the absolute or relative path to execute the command.
Alias for second-order execution
Third, execute bash Internal commands.
Fourth, run the first command in the search order defined by the $ PATH environment variable; echo $ path; you can see the path of a series of commands. The system command does not use the path, this is because the environment variable is set and is automatically searched.
Permanent save alias:
Edit the. bashrc file in the home directory and write alias Vi = 'vim.
Vim/root/. bashrc
Vim/home/. bashrc
Delete alias:
Unalias VI # unalias alias
Common bash shortcut keys:
CTRL + C terminate command
CTRL + l clear screen
CTRL + u command before deleting or cutting the cursor
CTRL + k delete or cut the content after the cursor
CTRL + y paste Ctrl + U or Ctrl + k cut content
CTRL + R search in the History command. After pressing CTRL + R, the search page appears. You only need to enter the search content and search from the history command.
CTRL + D Exit the current terminal (equivalent to Exit)
Bytes ------------------------------------------------------------------------------------------------------