Bash basic features: command line expansion
~: Automatically expands to the user's home directory, or the specified user's home directory;
{}: A comma-delimited list of paths can be hosted and can be expanded to multiple paths;
For example:/tmp/{a,b} is equivalent to/tmp/a/tmp/b
Exercise: Create the following directory structure:
/tmp/mysysroot/
|--bin
|--etc
| '--Sysconfig
| '--network-scripts
|--Sbin
|--usr
| |--bin
| |--Lib
| |--lib64
| |--Local
| | |--bin
| | |--etc
| | |--Lib
| | '--sbin
| '--sbin
'--Var
|--Cache
|--Log
'--run
~]# Mkdir-pv/tmp/mysysroot/{bin,sbin,etc/sysconfig/network-scripts,usr/{bin,sbin,local/{bin,sbin,etc,lib},lib, Lib64},var/{cache,log,run}}
Tree command:
tree [options] [directory]
-L Level: Specifies the hierarchy to display;
Bash's underlying features: command execution status results
Status result of the command execution:
Bash outputs this result with a status return value:
Success: 0
Failed: 1-255
After the command execution completes, its status return value is saved in Bash's special variable $?
When the command executes normally, some return the command value:
Depending on the command and its function, the results are different;
The execution result of the reference command:
$ (COMMAND)
or ' COMMAND '
Bash-based features: references
Strong quote: '
Weak reference: ""
Command reference: '
Bash Basic features: shortcut keys
CTRL + A: Jump to the beginning of the command line
Ctrl+e: Jump to the end of the command line
Ctrl+u: Deletes all the characters from the beginning of the line to the cursor position;
Ctrl+k: Removes all characters from the cursor to the end of the line;
Ctrl+l: Clear screen, equivalent to clear
Shell Programming (iii)