Opening current directory from a terminal onto a file browser?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite
5












My current directory is buried deep in multiple subfolder layers from my home directory. If I want to open this directory in a gui-based file browser, I have to double click folder after folder to reach it. This is very time consuming. On the other hand, with very few key strokes and several times hitting the tab button, it is very easily reachable via a terminal.



I want to know if there is a way to open the current directory in a terminal onto a a file browser. What is the command to do this?



For reference, I have an ubuntu system, but I'd like to know what the commands are across the various distributions of linux.










share|improve this question



















  • 2




    That really depends on what operating system and GUI environment you're using. For example, off the top of my head, on an OS X system, open /path/to/some/directory will open a Finder window for that directory. On Windows, it's some invocation of explorer.exe In KDE or GNOME or LXDE, there are probably incantations unique to each environment that can be used. In short, more detail is needed for your specific use-case.
    – DopeGhoti
    Nov 23 '15 at 17:57










  • That would depend on the specific "file explorer" or windowing system you are using. As a reference, on Mac OS X, open . will open a Finder window on the current directory. A similar command may exist on your system.
    – dhag
    Nov 23 '15 at 17:57










  • You should edit your question to include which GUI-based file explorer you're using / want to use.
    – Anthony Geoghegan
    Nov 23 '15 at 17:58






  • 4




    xdg-open works across many Linux distributions and desktop environments. Use . for the current directory, like: xdg-open .
    – drewbenn
    Nov 23 '15 at 18:03










  • @drewbenn: I would post that as an answer, as that will work for different environments.
    – saiarcot895
    Nov 23 '15 at 21:31














up vote
5
down vote

favorite
5












My current directory is buried deep in multiple subfolder layers from my home directory. If I want to open this directory in a gui-based file browser, I have to double click folder after folder to reach it. This is very time consuming. On the other hand, with very few key strokes and several times hitting the tab button, it is very easily reachable via a terminal.



I want to know if there is a way to open the current directory in a terminal onto a a file browser. What is the command to do this?



For reference, I have an ubuntu system, but I'd like to know what the commands are across the various distributions of linux.










share|improve this question



















  • 2




    That really depends on what operating system and GUI environment you're using. For example, off the top of my head, on an OS X system, open /path/to/some/directory will open a Finder window for that directory. On Windows, it's some invocation of explorer.exe In KDE or GNOME or LXDE, there are probably incantations unique to each environment that can be used. In short, more detail is needed for your specific use-case.
    – DopeGhoti
    Nov 23 '15 at 17:57










  • That would depend on the specific "file explorer" or windowing system you are using. As a reference, on Mac OS X, open . will open a Finder window on the current directory. A similar command may exist on your system.
    – dhag
    Nov 23 '15 at 17:57










  • You should edit your question to include which GUI-based file explorer you're using / want to use.
    – Anthony Geoghegan
    Nov 23 '15 at 17:58






  • 4




    xdg-open works across many Linux distributions and desktop environments. Use . for the current directory, like: xdg-open .
    – drewbenn
    Nov 23 '15 at 18:03










  • @drewbenn: I would post that as an answer, as that will work for different environments.
    – saiarcot895
    Nov 23 '15 at 21:31












up vote
5
down vote

favorite
5









up vote
5
down vote

favorite
5






5





My current directory is buried deep in multiple subfolder layers from my home directory. If I want to open this directory in a gui-based file browser, I have to double click folder after folder to reach it. This is very time consuming. On the other hand, with very few key strokes and several times hitting the tab button, it is very easily reachable via a terminal.



I want to know if there is a way to open the current directory in a terminal onto a a file browser. What is the command to do this?



For reference, I have an ubuntu system, but I'd like to know what the commands are across the various distributions of linux.










share|improve this question















My current directory is buried deep in multiple subfolder layers from my home directory. If I want to open this directory in a gui-based file browser, I have to double click folder after folder to reach it. This is very time consuming. On the other hand, with very few key strokes and several times hitting the tab button, it is very easily reachable via a terminal.



I want to know if there is a way to open the current directory in a terminal onto a a file browser. What is the command to do this?



For reference, I have an ubuntu system, but I'd like to know what the commands are across the various distributions of linux.







command-line directory gui file-manager file-opening






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '15 at 23:39









Gilles

524k12610471577




524k12610471577










asked Nov 23 '15 at 17:53









Paul

1,79892026




1,79892026







  • 2




    That really depends on what operating system and GUI environment you're using. For example, off the top of my head, on an OS X system, open /path/to/some/directory will open a Finder window for that directory. On Windows, it's some invocation of explorer.exe In KDE or GNOME or LXDE, there are probably incantations unique to each environment that can be used. In short, more detail is needed for your specific use-case.
    – DopeGhoti
    Nov 23 '15 at 17:57










  • That would depend on the specific "file explorer" or windowing system you are using. As a reference, on Mac OS X, open . will open a Finder window on the current directory. A similar command may exist on your system.
    – dhag
    Nov 23 '15 at 17:57










  • You should edit your question to include which GUI-based file explorer you're using / want to use.
    – Anthony Geoghegan
    Nov 23 '15 at 17:58






  • 4




    xdg-open works across many Linux distributions and desktop environments. Use . for the current directory, like: xdg-open .
    – drewbenn
    Nov 23 '15 at 18:03










  • @drewbenn: I would post that as an answer, as that will work for different environments.
    – saiarcot895
    Nov 23 '15 at 21:31












  • 2




    That really depends on what operating system and GUI environment you're using. For example, off the top of my head, on an OS X system, open /path/to/some/directory will open a Finder window for that directory. On Windows, it's some invocation of explorer.exe In KDE or GNOME or LXDE, there are probably incantations unique to each environment that can be used. In short, more detail is needed for your specific use-case.
    – DopeGhoti
    Nov 23 '15 at 17:57










  • That would depend on the specific "file explorer" or windowing system you are using. As a reference, on Mac OS X, open . will open a Finder window on the current directory. A similar command may exist on your system.
    – dhag
    Nov 23 '15 at 17:57










  • You should edit your question to include which GUI-based file explorer you're using / want to use.
    – Anthony Geoghegan
    Nov 23 '15 at 17:58






  • 4




    xdg-open works across many Linux distributions and desktop environments. Use . for the current directory, like: xdg-open .
    – drewbenn
    Nov 23 '15 at 18:03










  • @drewbenn: I would post that as an answer, as that will work for different environments.
    – saiarcot895
    Nov 23 '15 at 21:31







2




2




That really depends on what operating system and GUI environment you're using. For example, off the top of my head, on an OS X system, open /path/to/some/directory will open a Finder window for that directory. On Windows, it's some invocation of explorer.exe In KDE or GNOME or LXDE, there are probably incantations unique to each environment that can be used. In short, more detail is needed for your specific use-case.
– DopeGhoti
Nov 23 '15 at 17:57




That really depends on what operating system and GUI environment you're using. For example, off the top of my head, on an OS X system, open /path/to/some/directory will open a Finder window for that directory. On Windows, it's some invocation of explorer.exe In KDE or GNOME or LXDE, there are probably incantations unique to each environment that can be used. In short, more detail is needed for your specific use-case.
– DopeGhoti
Nov 23 '15 at 17:57












That would depend on the specific "file explorer" or windowing system you are using. As a reference, on Mac OS X, open . will open a Finder window on the current directory. A similar command may exist on your system.
– dhag
Nov 23 '15 at 17:57




That would depend on the specific "file explorer" or windowing system you are using. As a reference, on Mac OS X, open . will open a Finder window on the current directory. A similar command may exist on your system.
– dhag
Nov 23 '15 at 17:57












You should edit your question to include which GUI-based file explorer you're using / want to use.
– Anthony Geoghegan
Nov 23 '15 at 17:58




You should edit your question to include which GUI-based file explorer you're using / want to use.
– Anthony Geoghegan
Nov 23 '15 at 17:58




4




4




xdg-open works across many Linux distributions and desktop environments. Use . for the current directory, like: xdg-open .
– drewbenn
Nov 23 '15 at 18:03




xdg-open works across many Linux distributions and desktop environments. Use . for the current directory, like: xdg-open .
– drewbenn
Nov 23 '15 at 18:03












@drewbenn: I would post that as an answer, as that will work for different environments.
– saiarcot895
Nov 23 '15 at 21:31




@drewbenn: I would post that as an answer, as that will work for different environments.
– saiarcot895
Nov 23 '15 at 21:31










4 Answers
4






active

oldest

votes

















up vote
14
down vote



accepted










xdg-open .



xdg-open is part of the xdg-utils package, which is commonly installed by default in many distributions (including Ubuntu). It is designed to work for multiple desktop environments, calling the default handler for the file type in your desktop environment.



You can pass a directory, file, or URL, and it will open the proper program for that parameter. For example, on my KDE system:




  • xdg-open . opens the current directory in the Dolphin file manager


  • xdg-open foo.txt opens foo.txt in emacsclient, which I've configured to be the default handler for .txt files


  • xdg-open http://www.google.com/ opens google.com in my default web browser

The application opens as a separate window, and you'll get a prompt back in your terminal and can issue other commands or close your terminal without affecting your new GUI window.



I usually get a bunch of error message printed to stderr, but I just ignore them.



Edit:

Adding the arguments xdg-open . >/dev/null 2>&1 redirects the errors and the output. This call won't block your terminal. Binding this to an alias like filemanager='xdg-open . >/dev/null 2>&1' can come in handy.






share|improve this answer





























    up vote
    7
    down vote













    Almost any GUI application (on X window systems) can be opened from a terminal window within that GUI. To open any GUI app, type the name of the executable at the shell prompt. Most file browsers take a directory as a command line argument, so you should usually pass . as the parameter.



    Here are some examples for some popular systems, most X based systems work similarly.



    On Gnome, you can run nautilus (the default file browser) directly, or on Gnome 2, you can use gnome-open to open any file (including directories) with the configured Gnome file handler application:



    $ nautilus .


    or



    $ gnome-open .


    On KDE, there are two popular file browsers, I'm not aware of a command similar to gnome-open, though gnome-open can be executed within KDE, but by default it opens Gnome apps.



    $ dolphin .


    or



    $ konquerer .


    On OS X, as mentioned in comments, a similar command line program, open can be used.



    $ open .


    What if you don't know the executable name of your system's file browser?



    If on Gnome 2, use gnome-open . If on OS X, call open .. Each of these will execute the configured file browser for your GUI environment.



    If you don't know of such a command in your window system, here's one way to find out on systems with a ps command that understands the options -u USER and -o FORMAT:



    1. In your terminal window, type ps -u$USER -o comm > /tmp/$$A

    2. In your GUI, start the file browser.

    3. Back in your terminal window, type ps -u $USER -o comm > /tmp/$$B (Notice the B suffix, this is a different file than step 1).

    4. Also in the terminal, type diff /tmp/$$[AB].

    Should display the name of your file browser. It's possible you could see more than one name, if another program happened to start under your user id during the time between the calls to ps.



    For example:



    $ ps -u $USER -o comm > /tmp/$$A
    $ # open file browser in gui
    $ ps -u $USER -o comm > /tmp/$$B
    $ diff /tmp/$$[AB]
    95a96
    > nautilus





    share|improve this answer






















    • If you don't know which file browser your system has, how can you find out from the command line?
      – Paul
      Nov 23 '15 at 20:12










    • @Paul, please see updated answer. Thanks.
      – RobertL
      Nov 23 '15 at 20:58

















    up vote
    2
    down vote













    Ubuntu uses as default file browser nautilus as far as I remember. Therefore to open a certain folder from terminal you can type something like the following:



    nautilus /path/to/your/dir


    or



    cd /path/to/your/dir && nautilus .


    nautilus automatically deataches itself from the terminal it was called, but suppose you are using another file browser, and you want to close the terminal from which you called your file browser, you can use nohup to do so. If you are using, let's say, thunar (another file browser), you can type the following:



    nohup thunar /path/to/your/dir & exit





    share|improve this answer



























      up vote
      -1
      down vote













      Simply use gio open



      Use -



      gio open .
      gio open example/






      share|improve this answer




















        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "106"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f244970%2fopening-current-directory-from-a-terminal-onto-a-file-browser%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        14
        down vote



        accepted










        xdg-open .



        xdg-open is part of the xdg-utils package, which is commonly installed by default in many distributions (including Ubuntu). It is designed to work for multiple desktop environments, calling the default handler for the file type in your desktop environment.



        You can pass a directory, file, or URL, and it will open the proper program for that parameter. For example, on my KDE system:




        • xdg-open . opens the current directory in the Dolphin file manager


        • xdg-open foo.txt opens foo.txt in emacsclient, which I've configured to be the default handler for .txt files


        • xdg-open http://www.google.com/ opens google.com in my default web browser

        The application opens as a separate window, and you'll get a prompt back in your terminal and can issue other commands or close your terminal without affecting your new GUI window.



        I usually get a bunch of error message printed to stderr, but I just ignore them.



        Edit:

        Adding the arguments xdg-open . >/dev/null 2>&1 redirects the errors and the output. This call won't block your terminal. Binding this to an alias like filemanager='xdg-open . >/dev/null 2>&1' can come in handy.






        share|improve this answer


























          up vote
          14
          down vote



          accepted










          xdg-open .



          xdg-open is part of the xdg-utils package, which is commonly installed by default in many distributions (including Ubuntu). It is designed to work for multiple desktop environments, calling the default handler for the file type in your desktop environment.



          You can pass a directory, file, or URL, and it will open the proper program for that parameter. For example, on my KDE system:




          • xdg-open . opens the current directory in the Dolphin file manager


          • xdg-open foo.txt opens foo.txt in emacsclient, which I've configured to be the default handler for .txt files


          • xdg-open http://www.google.com/ opens google.com in my default web browser

          The application opens as a separate window, and you'll get a prompt back in your terminal and can issue other commands or close your terminal without affecting your new GUI window.



          I usually get a bunch of error message printed to stderr, but I just ignore them.



          Edit:

          Adding the arguments xdg-open . >/dev/null 2>&1 redirects the errors and the output. This call won't block your terminal. Binding this to an alias like filemanager='xdg-open . >/dev/null 2>&1' can come in handy.






          share|improve this answer
























            up vote
            14
            down vote



            accepted







            up vote
            14
            down vote



            accepted






            xdg-open .



            xdg-open is part of the xdg-utils package, which is commonly installed by default in many distributions (including Ubuntu). It is designed to work for multiple desktop environments, calling the default handler for the file type in your desktop environment.



            You can pass a directory, file, or URL, and it will open the proper program for that parameter. For example, on my KDE system:




            • xdg-open . opens the current directory in the Dolphin file manager


            • xdg-open foo.txt opens foo.txt in emacsclient, which I've configured to be the default handler for .txt files


            • xdg-open http://www.google.com/ opens google.com in my default web browser

            The application opens as a separate window, and you'll get a prompt back in your terminal and can issue other commands or close your terminal without affecting your new GUI window.



            I usually get a bunch of error message printed to stderr, but I just ignore them.



            Edit:

            Adding the arguments xdg-open . >/dev/null 2>&1 redirects the errors and the output. This call won't block your terminal. Binding this to an alias like filemanager='xdg-open . >/dev/null 2>&1' can come in handy.






            share|improve this answer














            xdg-open .



            xdg-open is part of the xdg-utils package, which is commonly installed by default in many distributions (including Ubuntu). It is designed to work for multiple desktop environments, calling the default handler for the file type in your desktop environment.



            You can pass a directory, file, or URL, and it will open the proper program for that parameter. For example, on my KDE system:




            • xdg-open . opens the current directory in the Dolphin file manager


            • xdg-open foo.txt opens foo.txt in emacsclient, which I've configured to be the default handler for .txt files


            • xdg-open http://www.google.com/ opens google.com in my default web browser

            The application opens as a separate window, and you'll get a prompt back in your terminal and can issue other commands or close your terminal without affecting your new GUI window.



            I usually get a bunch of error message printed to stderr, but I just ignore them.



            Edit:

            Adding the arguments xdg-open . >/dev/null 2>&1 redirects the errors and the output. This call won't block your terminal. Binding this to an alias like filemanager='xdg-open . >/dev/null 2>&1' can come in handy.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 27 at 16:10









            rodeo

            32




            32










            answered Nov 23 '15 at 21:59









            drewbenn

            5,14251836




            5,14251836






















                up vote
                7
                down vote













                Almost any GUI application (on X window systems) can be opened from a terminal window within that GUI. To open any GUI app, type the name of the executable at the shell prompt. Most file browsers take a directory as a command line argument, so you should usually pass . as the parameter.



                Here are some examples for some popular systems, most X based systems work similarly.



                On Gnome, you can run nautilus (the default file browser) directly, or on Gnome 2, you can use gnome-open to open any file (including directories) with the configured Gnome file handler application:



                $ nautilus .


                or



                $ gnome-open .


                On KDE, there are two popular file browsers, I'm not aware of a command similar to gnome-open, though gnome-open can be executed within KDE, but by default it opens Gnome apps.



                $ dolphin .


                or



                $ konquerer .


                On OS X, as mentioned in comments, a similar command line program, open can be used.



                $ open .


                What if you don't know the executable name of your system's file browser?



                If on Gnome 2, use gnome-open . If on OS X, call open .. Each of these will execute the configured file browser for your GUI environment.



                If you don't know of such a command in your window system, here's one way to find out on systems with a ps command that understands the options -u USER and -o FORMAT:



                1. In your terminal window, type ps -u$USER -o comm > /tmp/$$A

                2. In your GUI, start the file browser.

                3. Back in your terminal window, type ps -u $USER -o comm > /tmp/$$B (Notice the B suffix, this is a different file than step 1).

                4. Also in the terminal, type diff /tmp/$$[AB].

                Should display the name of your file browser. It's possible you could see more than one name, if another program happened to start under your user id during the time between the calls to ps.



                For example:



                $ ps -u $USER -o comm > /tmp/$$A
                $ # open file browser in gui
                $ ps -u $USER -o comm > /tmp/$$B
                $ diff /tmp/$$[AB]
                95a96
                > nautilus





                share|improve this answer






















                • If you don't know which file browser your system has, how can you find out from the command line?
                  – Paul
                  Nov 23 '15 at 20:12










                • @Paul, please see updated answer. Thanks.
                  – RobertL
                  Nov 23 '15 at 20:58














                up vote
                7
                down vote













                Almost any GUI application (on X window systems) can be opened from a terminal window within that GUI. To open any GUI app, type the name of the executable at the shell prompt. Most file browsers take a directory as a command line argument, so you should usually pass . as the parameter.



                Here are some examples for some popular systems, most X based systems work similarly.



                On Gnome, you can run nautilus (the default file browser) directly, or on Gnome 2, you can use gnome-open to open any file (including directories) with the configured Gnome file handler application:



                $ nautilus .


                or



                $ gnome-open .


                On KDE, there are two popular file browsers, I'm not aware of a command similar to gnome-open, though gnome-open can be executed within KDE, but by default it opens Gnome apps.



                $ dolphin .


                or



                $ konquerer .


                On OS X, as mentioned in comments, a similar command line program, open can be used.



                $ open .


                What if you don't know the executable name of your system's file browser?



                If on Gnome 2, use gnome-open . If on OS X, call open .. Each of these will execute the configured file browser for your GUI environment.



                If you don't know of such a command in your window system, here's one way to find out on systems with a ps command that understands the options -u USER and -o FORMAT:



                1. In your terminal window, type ps -u$USER -o comm > /tmp/$$A

                2. In your GUI, start the file browser.

                3. Back in your terminal window, type ps -u $USER -o comm > /tmp/$$B (Notice the B suffix, this is a different file than step 1).

                4. Also in the terminal, type diff /tmp/$$[AB].

                Should display the name of your file browser. It's possible you could see more than one name, if another program happened to start under your user id during the time between the calls to ps.



                For example:



                $ ps -u $USER -o comm > /tmp/$$A
                $ # open file browser in gui
                $ ps -u $USER -o comm > /tmp/$$B
                $ diff /tmp/$$[AB]
                95a96
                > nautilus





                share|improve this answer






















                • If you don't know which file browser your system has, how can you find out from the command line?
                  – Paul
                  Nov 23 '15 at 20:12










                • @Paul, please see updated answer. Thanks.
                  – RobertL
                  Nov 23 '15 at 20:58












                up vote
                7
                down vote










                up vote
                7
                down vote









                Almost any GUI application (on X window systems) can be opened from a terminal window within that GUI. To open any GUI app, type the name of the executable at the shell prompt. Most file browsers take a directory as a command line argument, so you should usually pass . as the parameter.



                Here are some examples for some popular systems, most X based systems work similarly.



                On Gnome, you can run nautilus (the default file browser) directly, or on Gnome 2, you can use gnome-open to open any file (including directories) with the configured Gnome file handler application:



                $ nautilus .


                or



                $ gnome-open .


                On KDE, there are two popular file browsers, I'm not aware of a command similar to gnome-open, though gnome-open can be executed within KDE, but by default it opens Gnome apps.



                $ dolphin .


                or



                $ konquerer .


                On OS X, as mentioned in comments, a similar command line program, open can be used.



                $ open .


                What if you don't know the executable name of your system's file browser?



                If on Gnome 2, use gnome-open . If on OS X, call open .. Each of these will execute the configured file browser for your GUI environment.



                If you don't know of such a command in your window system, here's one way to find out on systems with a ps command that understands the options -u USER and -o FORMAT:



                1. In your terminal window, type ps -u$USER -o comm > /tmp/$$A

                2. In your GUI, start the file browser.

                3. Back in your terminal window, type ps -u $USER -o comm > /tmp/$$B (Notice the B suffix, this is a different file than step 1).

                4. Also in the terminal, type diff /tmp/$$[AB].

                Should display the name of your file browser. It's possible you could see more than one name, if another program happened to start under your user id during the time between the calls to ps.



                For example:



                $ ps -u $USER -o comm > /tmp/$$A
                $ # open file browser in gui
                $ ps -u $USER -o comm > /tmp/$$B
                $ diff /tmp/$$[AB]
                95a96
                > nautilus





                share|improve this answer














                Almost any GUI application (on X window systems) can be opened from a terminal window within that GUI. To open any GUI app, type the name of the executable at the shell prompt. Most file browsers take a directory as a command line argument, so you should usually pass . as the parameter.



                Here are some examples for some popular systems, most X based systems work similarly.



                On Gnome, you can run nautilus (the default file browser) directly, or on Gnome 2, you can use gnome-open to open any file (including directories) with the configured Gnome file handler application:



                $ nautilus .


                or



                $ gnome-open .


                On KDE, there are two popular file browsers, I'm not aware of a command similar to gnome-open, though gnome-open can be executed within KDE, but by default it opens Gnome apps.



                $ dolphin .


                or



                $ konquerer .


                On OS X, as mentioned in comments, a similar command line program, open can be used.



                $ open .


                What if you don't know the executable name of your system's file browser?



                If on Gnome 2, use gnome-open . If on OS X, call open .. Each of these will execute the configured file browser for your GUI environment.



                If you don't know of such a command in your window system, here's one way to find out on systems with a ps command that understands the options -u USER and -o FORMAT:



                1. In your terminal window, type ps -u$USER -o comm > /tmp/$$A

                2. In your GUI, start the file browser.

                3. Back in your terminal window, type ps -u $USER -o comm > /tmp/$$B (Notice the B suffix, this is a different file than step 1).

                4. Also in the terminal, type diff /tmp/$$[AB].

                Should display the name of your file browser. It's possible you could see more than one name, if another program happened to start under your user id during the time between the calls to ps.



                For example:



                $ ps -u $USER -o comm > /tmp/$$A
                $ # open file browser in gui
                $ ps -u $USER -o comm > /tmp/$$B
                $ diff /tmp/$$[AB]
                95a96
                > nautilus






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 23 '15 at 21:13

























                answered Nov 23 '15 at 18:29









                RobertL

                4,788624




                4,788624











                • If you don't know which file browser your system has, how can you find out from the command line?
                  – Paul
                  Nov 23 '15 at 20:12










                • @Paul, please see updated answer. Thanks.
                  – RobertL
                  Nov 23 '15 at 20:58
















                • If you don't know which file browser your system has, how can you find out from the command line?
                  – Paul
                  Nov 23 '15 at 20:12










                • @Paul, please see updated answer. Thanks.
                  – RobertL
                  Nov 23 '15 at 20:58















                If you don't know which file browser your system has, how can you find out from the command line?
                – Paul
                Nov 23 '15 at 20:12




                If you don't know which file browser your system has, how can you find out from the command line?
                – Paul
                Nov 23 '15 at 20:12












                @Paul, please see updated answer. Thanks.
                – RobertL
                Nov 23 '15 at 20:58




                @Paul, please see updated answer. Thanks.
                – RobertL
                Nov 23 '15 at 20:58










                up vote
                2
                down vote













                Ubuntu uses as default file browser nautilus as far as I remember. Therefore to open a certain folder from terminal you can type something like the following:



                nautilus /path/to/your/dir


                or



                cd /path/to/your/dir && nautilus .


                nautilus automatically deataches itself from the terminal it was called, but suppose you are using another file browser, and you want to close the terminal from which you called your file browser, you can use nohup to do so. If you are using, let's say, thunar (another file browser), you can type the following:



                nohup thunar /path/to/your/dir & exit





                share|improve this answer
























                  up vote
                  2
                  down vote













                  Ubuntu uses as default file browser nautilus as far as I remember. Therefore to open a certain folder from terminal you can type something like the following:



                  nautilus /path/to/your/dir


                  or



                  cd /path/to/your/dir && nautilus .


                  nautilus automatically deataches itself from the terminal it was called, but suppose you are using another file browser, and you want to close the terminal from which you called your file browser, you can use nohup to do so. If you are using, let's say, thunar (another file browser), you can type the following:



                  nohup thunar /path/to/your/dir & exit





                  share|improve this answer






















                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    Ubuntu uses as default file browser nautilus as far as I remember. Therefore to open a certain folder from terminal you can type something like the following:



                    nautilus /path/to/your/dir


                    or



                    cd /path/to/your/dir && nautilus .


                    nautilus automatically deataches itself from the terminal it was called, but suppose you are using another file browser, and you want to close the terminal from which you called your file browser, you can use nohup to do so. If you are using, let's say, thunar (another file browser), you can type the following:



                    nohup thunar /path/to/your/dir & exit





                    share|improve this answer












                    Ubuntu uses as default file browser nautilus as far as I remember. Therefore to open a certain folder from terminal you can type something like the following:



                    nautilus /path/to/your/dir


                    or



                    cd /path/to/your/dir && nautilus .


                    nautilus automatically deataches itself from the terminal it was called, but suppose you are using another file browser, and you want to close the terminal from which you called your file browser, you can use nohup to do so. If you are using, let's say, thunar (another file browser), you can type the following:



                    nohup thunar /path/to/your/dir & exit






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 23 '15 at 18:39









                    Kira

                    2,972823




                    2,972823




















                        up vote
                        -1
                        down vote













                        Simply use gio open



                        Use -



                        gio open .
                        gio open example/






                        share|improve this answer
























                          up vote
                          -1
                          down vote













                          Simply use gio open



                          Use -



                          gio open .
                          gio open example/






                          share|improve this answer






















                            up vote
                            -1
                            down vote










                            up vote
                            -1
                            down vote









                            Simply use gio open



                            Use -



                            gio open .
                            gio open example/






                            share|improve this answer












                            Simply use gio open



                            Use -



                            gio open .
                            gio open example/







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 10 '17 at 20:11









                            vedipen

                            1




                            1



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f244970%2fopening-current-directory-from-a-terminal-onto-a-file-browser%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown






                                Popular posts from this blog

                                Peggy Mitchell

                                The Forum (Inglewood, California)

                                Palaiologos