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?

3
  • How do you open a file in the terminal?
    – Braiam
    Jul 26, 2014 at 13:46
  • simply gnome-text-editor "<filename>"
    – Pandya
    Jul 26, 2014 at 13:52
  • 2
    Unclear/misunderstanding that if you want to open file in terminal or launching gui app by command-line?
    – Pandya
    Jul 26, 2014 at 13:55

3 Answers 3

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.

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.

Not the answer you're looking for? Browse other questions tagged .