Create new file ubuntu 18.04
To create a new file in Ubuntu 18.04, you can use a text editor such as nano
, gedit
, or vim
. Here are the steps:
Method 1: Using nano
- Open a terminal window.
- Type
nano newfile.txt
(replacenewfile.txt
with the name you want to give your file). - Press Enter to create the file.
- Type some text into the file using the nano editor.
- Press
Ctrl+X
to exit the editor. - Press
Y
to save the changes. - Press Enter to confirm the file name.
Method 2: Using gedit
- Open a terminal window.
- Type
gedit newfile.txt
(replacenewfile.txt
with the name you want to give your file). - Press Enter to create the file.
- Type some text into the file using the gedit editor.
- Click on "File" > "Save" to save the changes.
- Close the gedit window.
Method 3: Using vim
- Open a terminal window.
- Type
vim newfile.txt
(replacenewfile.txt
with the name you want to give your file). - Press Enter to create the file.
- Type some text into the file using the vim editor.
- Press
Esc
to exit insert mode. - Type
:wq
to save and quit the editor.
In all cases, the new file will be created in your current working directory. You can verify this by using the ls
command to list the files in the directory.