How to create text file, using Linux cat command



Configuration for GNU Linux Fedora Computer using Linux Command

 

   How to create text file on Linux Fedora system???... There is lot of text editor in Linux that you can use to create text files, but the easers one to create text file is with the cat command.  The cat command or concatenate can be use to create text file or displaying them on Linux system.  The cat command example below, show the step by step to use the cat command to create text file

1.  cat Command Example:

                                                     |  redirect the output to...

                                                     \                        | new text file name

[root@fedora ~]# cat > text_file_example.txt 

This is my new text file

This is Linux text file

Create text file and ...

this is the last line...

                         <---------Push Ctrl+D key here

[root@fedora ~]#

create text file on linux using cat command

[root@fedora ~]# cat > text_file_example.txt

This is my new text file

This is Linux text file

Create text file and ...

this is the last line...

 

[root@fedora ~]#

 

2.  Verify the cat Command output:

view text file on linux using cat command

still use the cat command but no > redirect sign

[root@fedora ~]# cat text_file_example.txt

This is my new text file

This is Linux text file

Create text file and ...

this is the last line...

 

[root@fedora ~]#

 




0 comments: