3

I could not find the section as you can open the file in a graphics mode, that is such a file 1.txt terminal displays the contents but I would love to see it with the gedit or another text editor?

Braiam
  • 67,791
  • 32
  • 179
  • 269
Andrew
  • 41
  • 1
  • 1
  • 6

3 Answers3

5

You can do that by entering the program name before the file name.

So to open index.html with gedit from a terminal you would use :

gedit index.html

It should be noted that this will run from the terminal, if you want to separate it and continue using the terminal simply add an & after the command, for example :

gedit index.html &
5

Opening a text file in a text editor is as simple as Fernhill Linux Project's answer.

For a more generic "open with default program" command you may type xdg-open filename.

A video file would open with your default video player, a text file with your default text editor, etc.

This has the added advantage that you may close the terminal window without closing the application.

To Do
  • 15,502
0

You would just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

<program_name>
or
sudo <program_name>

To open a .txt file using gedit from terminal, you would do

gedit <file_name>

Note: Make sure that the program that you're trying to open is in your path; otherwise you have to enter the complete path.

Mitch
  • 107,631