- Command history
History
Environment variables:
Histsize: Number of records in the command history
Histfile:~/.bash_history
Histfilesize: The number of history records in a command history file
history-d OFFSET: Delete a History
History + Numbers: Show the last n record commands
Call History Command:
! + numbers: for example! 3: Repeat the Third historical command
!! : Repeats the previous command
! String: The most recent command to start with the specified string
Call the last parameter of the previous command:
! $
ESC and then press.
Alt +.
Control how the Command history is recorded:
Environment variable: Histcontrol
Ignoredups: Ignore duplicate commands (commands must be sequential and duplicate)
Ignorespace: Ignore commands that begin with whitespace
Ignoreboth: All two are ignored.
Modify environment variable Value: Export variable name = "Value"
2. Command completion
Bash Execution Command:
Internal command:
External command: Bash searches for a file named after a given command name from the left and right, based on the path defined by the PATH environment variable, the command to be executed the first time it is found
Direct completion: Tab, the user given a string with only one single corresponding command
Indirect completion: The user given a string for the beginning of the corresponding command is not unique, double-click tab to give all the list of satisfied conditions
3. Path completion
Take the user-given string as the beginning of the path and search for the file name at the beginning of the specified string with the specified parent directory:
If only: the direct complement
If not unique: press TAB again to display the list of all conditions that meet
4. Command line expansion
~: Expand to the user's home directory
~username: Expand the home directory for the specified user
{}: Can host a comma-delimited list and expand to multiple paths
For example:/tmp/{a,b} =/tmp/a and/tmp/b
/TMP/{A,B}/C = tmp/a/c and/tmp/b/c
5. Directory Management class commands
mkdir [Options]/path/to/somewhere
-P: If the intermediate directory does not exist, do not error, step by step to create a directory
-V: Show more information
-M: Specify permissions when creating a directory
Tree
-D: Show only directories
-L: Specify the number of levels to display
-P: Displays only the path that is matched by the specified P
RmDir: Delete Empty directory
-V: Display procedure
The basic features of the Linux Command Bash (1) (Command history, command completion, path completion, command line expansion). )