How To Create File In Linux with Different Ways?

RSS
FACEBOOK
FACEBOOK
PINTEREST
PINTEREST
LINKEDIN
INSTAGRAM

Sometimes creating a file empty or with a little content can be important. In this post we will look how to create a file from command line interface. Here is alternative ways to create files.

Touch

Touch command is the first choice for creating empty file with the current user ownership.

Touch

Touch

Echo

Echo command is very useful command to put string into the standard output. I we redirect our output to a file new file will be created.

Echo

Echo

We can provide some text data to put into newly created file.

Cat

Cat is a command especially created for concatenate files and print on the standard output.

Cat

Cat

After putting command we should press CTRL+d to exit from input mode.

RSS
FACEBOOK
FACEBOOK
PINTEREST
PINTEREST
LINKEDIN
INSTAGRAM

Leave a Reply

Your email address will not be published. Required fields are marked *

Open

Enjoy this blog? Please spread the word :)