×


Save a File in Linux Mint 20.3 Using the Cat Command

The usage of the cat command in Linux is quite versatile since it can be used to create, read, write, and concatenate files. Apart from this, the cat command can also be used to save the files in Linux. 

Here at Ibmi Media, we shall look into how to save a file in Linux Mint 20.3 with the help of the cat command.


Steps for saving a File in Linux Mint 20.3 using the Cat Command

1. Create a Sample File with the Cat Command

To begin, you need to create a sample file with the below command:

$ cat > sample.txt

You can replace "sample.txt" with any name of your choice for the file that you want to create.

Once you will execute this command, you will be allowed to start typing anything into this file. We have typed some sample content in it.


2. Save the Sample File with the Cat Command

To save the file created with the cat command within your terminal, you just need to press Ctrl+ D. When you will do that, the control of the terminal will be handed back to you and your file will be saved.


3. Verify if the Sample File has been saved or not

To verify if the sample file has been saved successfully or not, we will view its contents with the cat command by running:

$ cat sample.txt


[Need help in fixing Linux Mint system issues ? We can help you. ]


Conclusion

This article covers the procedure of saving a file in Linux Mint 20.3 with the help of the cat command. In fact, By using this method, you will now be able to save your files while staying within the terminal very conveniently.