# Text Processing

| Command                                                     | Description                                                      | Example                                                                 |
| ----------------------------------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------- |
| <mark style="color:red;">**cat**</mark>                     | Concatenate and display file contents.                           | cat file.txt → Displays the content of file.txt.                        |
| <mark style="color:red;">**grep \[pattern] \[file]**</mark> | Search for a pattern in a file.                                  | grep "error" log.txt → Searches for "error" in log.txt.                 |
| <mark style="color:red;">**awk**</mark>                     | Pattern scanning and processing language.                        | awk '{print $1}' file.txt → Prints the first column of file.txt.        |
| <mark style="color:red;">**sed**</mark>                     | Stream editor for text manipulation.                             | sed 's/old/new/g' file.txt → Replaces "old" with "new" in file.txt.     |
| <mark style="color:red;">**sort**</mark>                    | Sort lines of text files.                                        | sort file.txt → Sorts the lines in file.txt.                            |
| <mark style="color:red;">**cut**</mark>                     | Remove sections from each line of a file.                        | cut -d',' -f1 file.csv → Extracts the first column from file.csv.       |
| <mark style="color:red;">**uniq**</mark>                    | Report or omit repeated lines.                                   | uniq file.txt → Removes duplicate lines from file.txt.                  |
| <mark style="color:red;">**tr**</mark>                      | Translate or delete characters.                                  | tr 'a-z' 'A-Z' → Converts lowercase letters to uppercase.               |
| <mark style="color:red;">**wc**</mark>                      | Count lines, words, and characters in a file.                    | wc file.txt → Displays the line, word, and character count of file.txt. |
| <mark style="color:red;">**tee**</mark>                     | Read from standard input and write to standard output and files. | \`echo "Hello"                                                          |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devops-3.gitbook.io/devops/docs/linux-cheat-sheet/text-processing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
