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.

Cat

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

cat>simplefile.txt 
I am a file
Ctrl+Z
‚Äč

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

gedit

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

gedit myfile

Which will open the GUI editor

vi

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

Manoj

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:

WordPress.com Logo

You are commenting using your WordPress.com 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.