How to create a file in Linux?

Published July 11, 2021

To create a file, you can use the touch command followed by the name of the file with the extension in Linux.

For example, to create a file with the name Hello.txt, you can use the touch command like this,

# Make a file in Linux
touch Hello.txt

This will create a file named Hello.txt.

See the above code live in repl.it

You can also make more than one file in a single command by adding a space and then writing the file name with the extension like this,

# Make 2 files in a single command in Linux
touch Hello.txt Hello2.txt

That's all 😃!

Feel free to share if you found this useful 😃.


Share on: Facebook Twitter