How to create a file in Ubuntu

We have many option to create a simple file in Terminal of Linux . The examples were working in Ubuntu and most other Linux distributions.


The cat command can be use to create and view simple files.

I am a file

Will create a file and can be viewed using cat simplefile.txt command.


gedit GUI text editor which can be also used to create file from terminal using

gedit myfile

Which will open the GUI editor


Ubuntu also have the classic vi command which can be used to create and edit file from the console

vi filename

You can also get the help for each command using command –help

Published by


A developer,teacher and a blogger obsessed with Python,Dart and open source world from India

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.