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 ~]#

 




1 comments:

Berthold Hanisch said...


Amazing blog! Do you have any tips and hints for aspiring writers? I'm planning to start my own website soon but I'm a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I'm totally confused .. Any tips? Appreciate it! all of craigslist