Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: How to open files from terminal

  1. #1
    Join Date
    Jun 2008
    Beans
    19

    How to open files from terminal

    Hey, I am kinda new to linux and I am just starting to use the terminal for more things and I was wondering if there is a way to open files, such as pictures, videos, and music, from the terminal. I was wondering because in the cmd prompt in windows (which I also just started using) you can open a file by just typing in the name of that file. Thanks in advance for any help.

  2. #2
    Join Date
    Sep 2006
    Location
    Solihull/Piraeus (UK/GR)
    Beans
    421
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: How to open files from terminal

    In the Gnome desktop you can use the command gnome-open for this, e.g.

    Code:
    gnome-open mypicture.jpg
    The generic equivalent, which should work for all Linux desktops that work with freedesktop.org standards, is xdg-open.

  3. #3
    Join Date
    Apr 2008
    Location
    Southern California, USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How to open files from terminal

    Quote Originally Posted by mman426 View Post
    Hey, I am kinda new to linux and I am just starting to use the terminal for more things and I was wondering if there is a way to open files, such as pictures, videos, and music, from the terminal. I was wondering because in the cmd prompt in windows (which I also just started using) you can open a file by just typing in the name of that file. Thanks in advance for any help.
    Yes, almost everything. The GUI part is just that, a graphics layered interface.
    In fact sometimes it pays to start a program using the Terminal.

    Case in point. It's fixed now, but Wine kept failing. I started it through the Terminal.
    For example:
    wine C:\\"Program Files"\\ImgBurn\\ImgBurn.exe

    Will start ImgBurn using Wine and I can see any errors that may occur. Even though ImgBurn has its own log file that displays errors. Using the Terminal reveals more information that may be of value for trouble shooting.

  4. #4
    Join Date
    Jun 2008
    Beans
    19

    Re: How to open files from terminal

    Quote Originally Posted by wdaniels View Post
    In the Gnome desktop you can use the command gnome-open for this, e.g.

    Code:
    gnome-open mypicture.jpg
    The generic equivalent, which should work for all Linux desktops that work with freedesktop.org standards, is xdg-open.
    Thanks that works perfectly, I really like to open from the terminal because I don't want to use the mouse and I want to increase my typing speed because right now it is pretty slow when I work in the terminal. I also figure that working in the terminal is the best way to learn the terminal, so I use it for pretty much everything now

  5. #5
    Join Date
    Sep 2006
    Location
    Solihull/Piraeus (UK/GR)
    Beans
    421
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: How to open files from terminal

    Quote Originally Posted by mman426 View Post
    I really like to open from the terminal because I don't want to use the mouse and I want to increase my typing speed because right now it is pretty slow when I work in the terminal. I also figure that working in the terminal is the best way to learn the terminal, so I use it for pretty much everything now
    That attitude will serve you well in Linux
    Last edited by wdaniels; June 9th, 2008 at 04:49 PM. Reason: sp

  6. #6
    Join Date
    Feb 2009
    Beans
    4

    Re: How to open files from terminal

    Hello, I am a total newbie to ubuntu.
    when i enter the command "gnome-open LOTR Evenstar.wma" nothing happens. could you please help.
    thanks.
    Last edited by tayl90mm; February 26th, 2009 at 06:16 AM. Reason: Typo

  7. #7
    Join Date
    Jul 2006
    Location
    EST (GMT -5)
    Beans
    542
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: How to open files from terminal

    Quote Originally Posted by tayl90mm View Post
    Hello, I am a total newbie to ubuntu.
    when i enter the command "gnome-open LOTR Evenstar.wma" nothing happens. could you please help.
    thanks.
    spaces (among other carachters) in filenames arent directly supported in the command line. you need to "escape" the carachter (basically tell the interpreter its part of the file name rather than serving some other function). the escape carachter is \ so it should look like

    LOTR\ Evenstar.wma

    i think double quotes work too. also, you can have the terminal auto complete your entry so you could type LOTR then press tab, and it will fill in the rest for you, including escaped carachters. i use this alot for torrents since the name of most are so rediculously long :-/

    if thats not the problem, then the wma file format might be
    toaster: PIII 1.0GHz Ubuntu Intrepid 2.6.27-7-server (headless)
    merom: Apple MacBook Pro -2.33GHz C2Duo - OSX 10.5.6
    mythb0x: P-D 2.66Ghz MythDora 3.2: 2.6.18 - PVR-150 - VIA Unichrome Pro - MSI Hetis 800 case

  8. #8
    Join Date
    May 2007
    Beans
    1,091

    Re: How to open files from terminal

    another terminal trick is that you can enter in
    Code:
    gnome-open LO
    and then hit the tab key. if there is only one file in the directory that you are in that begins with the letters LO, it will complete the filename for you.

  9. #9
    Join Date
    Jul 2006
    Location
    EST (GMT -5)
    Beans
    542
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: How to open files from terminal

    and if there are files that are similar, it will fill in up to the point where the similarities end
    toaster: PIII 1.0GHz Ubuntu Intrepid 2.6.27-7-server (headless)
    merom: Apple MacBook Pro -2.33GHz C2Duo - OSX 10.5.6
    mythb0x: P-D 2.66Ghz MythDora 3.2: 2.6.18 - PVR-150 - VIA Unichrome Pro - MSI Hetis 800 case

  10. #10
    Join Date
    Sep 2008
    Location
    Bangalore,India
    Beans
    982
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to open files from terminal

    well there are many applications for specific tasks to open files from terminal
    feh- for viewing pictures
    moc- for audio
    mplayer- for video
    Abhilash Muthuraj-views
    I always believe that Linux,
    "In a world of no walls or fences, we don't need WINDOWS or GATES"
    New to Ubuntu??

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •