added example with output redirect to new file (#27734)
This commit is contained in:
@ -34,8 +34,10 @@ Concatenate the content of the two files and display the result in terminal:
|
|||||||
cat file1.txt file2.txt
|
cat file1.txt file2.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Concatenate the content of two files and store it in a new file:
|
||||||
**Tip**: Using `cat` on a directory will cause error, so make sure it's a readable file.
|
```bash
|
||||||
|
cat file1.txt file2.txt > new_file.txt
|
||||||
|
```
|
||||||
|
|
||||||
Creating a new text file:
|
Creating a new text file:
|
||||||
```bash
|
```bash
|
||||||
@ -43,6 +45,7 @@ cat > yourfile.txt
|
|||||||
```
|
```
|
||||||
After pressing Enter, the cursor will be placed on the next line. You can start entering your desired text directly into your file. Press Ctrl+D or Ctrl+C to exit the file.
|
After pressing Enter, the cursor will be placed on the next line. You can start entering your desired text directly into your file. Press Ctrl+D or Ctrl+C to exit the file.
|
||||||
|
|
||||||
|
**Tip**: Using `cat` on a directory will cause error, so make sure it's a readable file.
|
||||||
|
|
||||||
#### More Information:
|
#### More Information:
|
||||||
* Wikipedia: https://en.wikipedia.org/wiki/Cat_(Unix)
|
* Wikipedia: https://en.wikipedia.org/wiki/Cat_(Unix)
|
||||||
|
Reference in New Issue
Block a user