From 7f6fba32c0358e89041274d7f37987e42386c2fd Mon Sep 17 00:00:00 2001 From: Alex Dumitru <43738450+Alex-Dumitru@users.noreply.github.com> Date: Mon, 18 Feb 2019 18:41:59 +0100 Subject: [PATCH] added example with output redirect to new file (#27734) --- guide/english/bash/bash-cat/index.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guide/english/bash/bash-cat/index.md b/guide/english/bash/bash-cat/index.md index 99b4d9d3db..628ccc81d0 100644 --- a/guide/english/bash/bash-cat/index.md +++ b/guide/english/bash/bash-cat/index.md @@ -34,8 +34,10 @@ Concatenate the content of the two files and display the result in terminal: cat file1.txt file2.txt ``` - -**Tip**: Using `cat` on a directory will cause error, so make sure it's a readable file. +Concatenate the content of two files and store it in a new file: +```bash +cat file1.txt file2.txt > new_file.txt +``` Creating a new text file: ```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. +**Tip**: Using `cat` on a directory will cause error, so make sure it's a readable file. #### More Information: * Wikipedia: https://en.wikipedia.org/wiki/Cat_(Unix)