Help answer threads with 0 replies.
Go Back > Blogs > Linux Gimux
User Name


An occasional blog about my recently discovered Linux gems!
Rate this Entry


Posted 04-18-2011 at 12:56 PM by myklmar

Open a text file in CLI

If you are working on the command line and you want an application to open a text file, do it
running a command.
However, this requires you to know the name of the application, which can be difficult to remember,(bad memory!) Especially if you don't know what application it was written in! But Linux has a solution for people like us. Its called gnome-open.

Gnome-open actually makes use of the gnome file handlers to decide what kind of application should be used to open a particular kind of file.
Suppose you want to open some file, say "file.ext" and you are not sure of the application that
handles the file format "ext", or you want to open a file called "news", then you can use gnome-open to ease your job.

First move to the directory in which the file is located: (ie Documents)
$ cd Documents
then type :
gnome-open news
Posted in Uncategorized
Views 5841 Comments 7
« Prev     Main     Next »
Total Comments 7


  1. Old Comment
    Great tip, it even works on my Suse kde desktop. That makes it a lot easier than trying to remember all the default programs.
    Posted 04-18-2011 at 06:58 PM by Larry Webb Larry Webb is offline
  2. Old Comment
    I just found out that it will not open Photos.
    Posted 04-19-2011 at 03:44 AM by Larry Webb Larry Webb is offline
  3. Old Comment
    Need to clarify above comments, first one checked out on laptop (Suse 11.2 kde), everything including pics opened

    Second on a desktop on (Suse 11.3 kde) and (linux-mint gnome). That command did not work on the second computer, will check later today to see if there is a dependence or setup different.
    Posted 04-19-2011 at 06:49 AM by Larry Webb Larry Webb is offline
  4. Old Comment
    Thanks Larry.
    Let me know what happens with your checking.
    Posted 04-19-2011 at 11:57 AM by myklmar myklmar is offline
  5. Old Comment
    I guess I was too tired the other day. I went back to check today and it worked on all my other distros.
    Posted 04-19-2011 at 08:15 PM by Larry Webb Larry Webb is offline
  6. Old Comment
    Ok here is my findings

    gnome-open worked on four of the major distros I tried (2 gnome and 2 kde)

    kde-open only worked on the two kde distros
    Posted 04-20-2011 at 09:53 AM by Larry Webb Larry Webb is offline
  7. Old Comment
    Thanks for the update.
    I will include that info. in next updated version of tips.
    Posted 04-20-2011 at 02:00 PM by myklmar myklmar is offline


All times are GMT -5. The time now is 11:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration