Added another usage of cat (#21928)
This commit is contained in:
committed by
Christopher McCormack
parent
eb58560950
commit
cf0caf5e8e
@ -9,6 +9,8 @@ title: Bash Cat
|
|||||||
`cat` is used to read a file sequentially and print it to the standard output.
|
`cat` is used to read a file sequentially and print it to the standard output.
|
||||||
The name is derived from its function to con**cat**enate files.
|
The name is derived from its function to con**cat**enate files.
|
||||||
|
|
||||||
|
Cat can also be used to create a text file.
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -36,6 +38,12 @@ cat file1.txt file2.txt
|
|||||||
|
|
||||||
**Tip**: Using `cat` on a directory will cause error, so make sure it's a readable file.
|
**Tip**: Using `cat` on a directory will cause error, so make sure it's a readable file.
|
||||||
|
|
||||||
|
Creating a new text file:
|
||||||
|
```bash
|
||||||
|
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.
|
||||||
|
|
||||||
#### 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