Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/books/admin_guide/15-three-swordsmen.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ tags:

# Overview

The GNU/Linux operating system follows the philosophy of "everything is a file". A side consequence of this philosopy is that system administrators often have to interact with files, file names and file contents.
The GNU/Linux operating system follows the philosophy of "everything is a file". A side consequence of this philosophy is that system administrators often have to interact with files, file names and file contents.

Regarding processing file content, the three tools grep, sed, and awk are potent and frequently used, so people call them the "Three Swordsmen".
Regarding processing file content, the three tools `grep`, `sed`, and `awk` are potent and frequently used, so people call them the "Three Swordsmen".

## Regular expressions VS wildcards

Expand All @@ -28,19 +28,20 @@ Similarities:
Differences:

* Regular expressions match file content; Wildcards are typically used to match file or directory names.
* Regular expressions can be used on commands such as `grep`, `sed`, `awk`, etc; Wildcards can be used on commands such as `cp`, `find`, `mv`, `touch`, `ls`, etc.
* Regular expressions are typically used on commands such as `grep`, `sed`, `awk`, and so on.
* Wildcards are typically used with commands such as `cp`, `find`, `mv`, `touch`, `ls`, and so on.

### Wildcards in GNU/Linux
### Wildcards in GNU/Linux

GNU/Linux OS supports these wildcards:
GNU/Linux operating systems support these wildcards:

| wildcards style | role |
| :---: | :---|
| ? | Matches one character of a file or directory name. |
| * | Matches 0 or more arbitrary characters of a file or directory name.|
| [ ] | Matches any single character in parentheses. For example, [one] which means to match o or n or e.|
| [-] | Matches any single character within the given range in parentheses. For example, [0-9] matches any single number from 0 to 9. |
| [^] | "logical non" matching of a single character. For example, [^a-zA-Z] represents matching a single nonletter character. |
| [^] | "logical non" matching of a single character. For example, [^a-zA-Z] represents matching a single non-letter character. |
| {,} | Non continuous matching of multiple single characters. Separated by commas. |
| {..} | Same as [-]. For example {0..9} and {a..z} |

Expand Down Expand Up @@ -134,7 +135,7 @@ ERE also supports characters with special meanings:

#### POSIX character

Sometimes, you may see "POSIX character"(also known as "POSIX character class").
Sometimes, you may see "POSIX character"(also known as "POSIX character class").
Please note that the author rarely uses the "POSIX character class", but has included this section to enhance basic understanding.

| POSIX character | equivalent to |
Expand Down Expand Up @@ -1973,7 +1974,6 @@ ID Name
7. ENVIRON

You can reference operating systems or user-defined variables in `awk` programs.
.

```bash
Shell > echo ${SSH_CLIENT}
Expand Down