Tagged with: Linux wildcard character bash
A. Bash Shell's operating environment
1. Path and command lookup order
If we enter a command and have multiple commands with the same name under Linux, which command will be executed? Here are some rules for order execution.
1). Execute the command in a relative/absolute path, for example: "/bin/ls" or "./ls"
2). The command is found by alias to execute
3). Executed by Bash's built-in (bulitin) command;
4). Find the first command execution by $path The order of this variable.
If you want to understand the order in which a command is executed, you can query by Type-a ls
2. We can modify/etc/issue and/ETC/MOTD to set the display information when logging in to bash.
Wildcard characters can be used in 3.bash to assist us in processing data conveniently. Here's a summary of common wildcard characters
*: represents 0 to countless multiple arbitrary characters descriptor Example: ll-d/etc/con* Find the file name that begins with con under/etc/
? : The representative must have an arbitrary character descriptor example: ll-d/etc/???? Find files with a file name of 5 characters under/etc/
[]: The representative must have a character within the brackets (not any character);
[-]: If a minus sign inside the brackets represents all the characters in the re-encoding order, for example [0-9] represents all numbers between 0 and 9.
[^]: denotes the original selection, [^a-z] stands for a character, as long as it is not a lowercase letter.
Bird's private cuisine--The 11th chapter: Understanding and Learning Bash