Ubuntu Linux Create a Text File Using cat Command

You can create a text file using the cat command in the terminal of an Ubuntu Linux system as follows:

  1. Open the terminal.
  2. Type cat > filename.txt and press Enter. This will open a new file with the name “filename.txt”.
  3. Type the text you want to add to the file and press Enter after each line.
  4. Once you are done adding text, press Ctrl + D to save the file and exit.

Note: The > operator is used to redirect the output of the cat command to a file. If the file already exists, its contents will be overwritten. If you want to append text to an existing file instead of overwriting it, use the >> operator instead.

(www.air-inc.com

Leave a Comment