How to open Nautilus at current command line directory?












64














I was wondering if anybody knew a command that would allow me to open a Nautilus (if that's the right name for the Ubuntu graphic/window explorer) window from the command line at the current directory that the user is at.



So, if I open a command line, and type:



cd /home/myUser/some/long/path/to/a/directory


Then, I'd like to be able to issue some command:



nautilus open-sesame


And have a graphic window opened to /home/myUser/some/long/path/to/a/directory. Is this even possible?










share|improve this question





























    64














    I was wondering if anybody knew a command that would allow me to open a Nautilus (if that's the right name for the Ubuntu graphic/window explorer) window from the command line at the current directory that the user is at.



    So, if I open a command line, and type:



    cd /home/myUser/some/long/path/to/a/directory


    Then, I'd like to be able to issue some command:



    nautilus open-sesame


    And have a graphic window opened to /home/myUser/some/long/path/to/a/directory. Is this even possible?










    share|improve this question



























      64












      64








      64


      14





      I was wondering if anybody knew a command that would allow me to open a Nautilus (if that's the right name for the Ubuntu graphic/window explorer) window from the command line at the current directory that the user is at.



      So, if I open a command line, and type:



      cd /home/myUser/some/long/path/to/a/directory


      Then, I'd like to be able to issue some command:



      nautilus open-sesame


      And have a graphic window opened to /home/myUser/some/long/path/to/a/directory. Is this even possible?










      share|improve this question















      I was wondering if anybody knew a command that would allow me to open a Nautilus (if that's the right name for the Ubuntu graphic/window explorer) window from the command line at the current directory that the user is at.



      So, if I open a command line, and type:



      cd /home/myUser/some/long/path/to/a/directory


      Then, I'd like to be able to issue some command:



      nautilus open-sesame


      And have a graphic window opened to /home/myUser/some/long/path/to/a/directory. Is this even possible?







      command-line nautilus filesystem






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 3 '16 at 18:01









      Jorge Castro

      35.9k105422617




      35.9k105422617










      asked Dec 8 '12 at 11:35









      zharvey

      67561422




      67561422






















          5 Answers
          5






          active

          oldest

          votes


















          89














          You can type in the terminal:



          cd /home/myUser/some/long/path/to/a/directory


          and then:



          nautilus .


          The above command will open nautilus in the folder /home/myUser/some/long/path/to/a/directory (the period is the current directory)



          Or in the Terminal just type:



          nautilus /home/myUser/some/long/path/to/a/directory





          share|improve this answer























          • I've been trying to figure out how to do this for literally years XD
            – Bryson S.
            Dec 12 '16 at 6:33










          • Invaluable command. Thanks.
            – Nik-Lz
            Dec 31 '16 at 21:57






          • 1




            won't work in ubuntu 16.04
            – Kasun Siyambalapitiya
            Aug 16 '17 at 18:31






          • 1




            @KasunSiyambalapitiya It does work on my Ubuntu 16.04.3 LTS with a fresh install and nothing special installed.
            – WinEunuuchs2Unix
            Feb 25 at 18:00






          • 1




            alias open="nautilus", and you can using $ open <PATH_HERE> like the MacOS.
            – Marslo
            May 10 at 8:30



















          13














          You can also do gnome-open .. gnome-open is similar to open on Mac which tries to open the file using the best matching application. By default, gnome-open . on Ubuntu will open the current directory in Nautilus.



          There is an open command in Ubuntu as well but it does not work in this case.






          share|improve this answer

















          • 4




            In Ubuntu 16.04 it isn't installed by default: "The program 'gnome-open' is currently not installed. You can install it by typing: sudo apt install libgnome2-bin"
            – WinEunuuchs2Unix
            Feb 25 at 17:59



















          1














          You should use xdg-open . (or xdg-open <path>) which is way more generic.






          share|improve this answer





























            1














            In order to avoid nasty warnings in my terminal I use nohup. To have it detached from my terminal I'm adding & at the end of my command. I also use the -w flag to open an new window.



            nohup nautilus -w . &


            Note that, nohup will create a file with warnings.



            You can send that to /dev/null like this:



            nohup nautilus -w . > /dev/null &





            share|improve this answer































              0














              To open nautilus from terminal.



              nautilus .



              To open nautilus in the background and still use the terminal.



              nohup nautilus . > /dev/null 2>&1 &



              You can also make that an alias.



              alias open='nohup nautilus . > /dev/null 2>&1 &'



              You can also add that alias to .bash_aliases, to have it persistent.



              echo "alias open='nohup nautilus . > /dev/null 2>&1 &'" >> .bash_aliases



              So now, after restarting the terminal, you can just type open.






              share|improve this answer










              New contributor




              Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.


















                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "89"
                };
                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',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                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%2faskubuntu.com%2fquestions%2f226755%2fhow-to-open-nautilus-at-current-command-line-directory%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                5 Answers
                5






                active

                oldest

                votes








                5 Answers
                5






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                89














                You can type in the terminal:



                cd /home/myUser/some/long/path/to/a/directory


                and then:



                nautilus .


                The above command will open nautilus in the folder /home/myUser/some/long/path/to/a/directory (the period is the current directory)



                Or in the Terminal just type:



                nautilus /home/myUser/some/long/path/to/a/directory





                share|improve this answer























                • I've been trying to figure out how to do this for literally years XD
                  – Bryson S.
                  Dec 12 '16 at 6:33










                • Invaluable command. Thanks.
                  – Nik-Lz
                  Dec 31 '16 at 21:57






                • 1




                  won't work in ubuntu 16.04
                  – Kasun Siyambalapitiya
                  Aug 16 '17 at 18:31






                • 1




                  @KasunSiyambalapitiya It does work on my Ubuntu 16.04.3 LTS with a fresh install and nothing special installed.
                  – WinEunuuchs2Unix
                  Feb 25 at 18:00






                • 1




                  alias open="nautilus", and you can using $ open <PATH_HERE> like the MacOS.
                  – Marslo
                  May 10 at 8:30
















                89














                You can type in the terminal:



                cd /home/myUser/some/long/path/to/a/directory


                and then:



                nautilus .


                The above command will open nautilus in the folder /home/myUser/some/long/path/to/a/directory (the period is the current directory)



                Or in the Terminal just type:



                nautilus /home/myUser/some/long/path/to/a/directory





                share|improve this answer























                • I've been trying to figure out how to do this for literally years XD
                  – Bryson S.
                  Dec 12 '16 at 6:33










                • Invaluable command. Thanks.
                  – Nik-Lz
                  Dec 31 '16 at 21:57






                • 1




                  won't work in ubuntu 16.04
                  – Kasun Siyambalapitiya
                  Aug 16 '17 at 18:31






                • 1




                  @KasunSiyambalapitiya It does work on my Ubuntu 16.04.3 LTS with a fresh install and nothing special installed.
                  – WinEunuuchs2Unix
                  Feb 25 at 18:00






                • 1




                  alias open="nautilus", and you can using $ open <PATH_HERE> like the MacOS.
                  – Marslo
                  May 10 at 8:30














                89












                89








                89






                You can type in the terminal:



                cd /home/myUser/some/long/path/to/a/directory


                and then:



                nautilus .


                The above command will open nautilus in the folder /home/myUser/some/long/path/to/a/directory (the period is the current directory)



                Or in the Terminal just type:



                nautilus /home/myUser/some/long/path/to/a/directory





                share|improve this answer














                You can type in the terminal:



                cd /home/myUser/some/long/path/to/a/directory


                and then:



                nautilus .


                The above command will open nautilus in the folder /home/myUser/some/long/path/to/a/directory (the period is the current directory)



                Or in the Terminal just type:



                nautilus /home/myUser/some/long/path/to/a/directory






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 1 '15 at 14:33









                Fabby

                26.4k1360159




                26.4k1360159










                answered Dec 8 '12 at 11:49









                Roman Raguet

                8,17113139




                8,17113139












                • I've been trying to figure out how to do this for literally years XD
                  – Bryson S.
                  Dec 12 '16 at 6:33










                • Invaluable command. Thanks.
                  – Nik-Lz
                  Dec 31 '16 at 21:57






                • 1




                  won't work in ubuntu 16.04
                  – Kasun Siyambalapitiya
                  Aug 16 '17 at 18:31






                • 1




                  @KasunSiyambalapitiya It does work on my Ubuntu 16.04.3 LTS with a fresh install and nothing special installed.
                  – WinEunuuchs2Unix
                  Feb 25 at 18:00






                • 1




                  alias open="nautilus", and you can using $ open <PATH_HERE> like the MacOS.
                  – Marslo
                  May 10 at 8:30


















                • I've been trying to figure out how to do this for literally years XD
                  – Bryson S.
                  Dec 12 '16 at 6:33










                • Invaluable command. Thanks.
                  – Nik-Lz
                  Dec 31 '16 at 21:57






                • 1




                  won't work in ubuntu 16.04
                  – Kasun Siyambalapitiya
                  Aug 16 '17 at 18:31






                • 1




                  @KasunSiyambalapitiya It does work on my Ubuntu 16.04.3 LTS with a fresh install and nothing special installed.
                  – WinEunuuchs2Unix
                  Feb 25 at 18:00






                • 1




                  alias open="nautilus", and you can using $ open <PATH_HERE> like the MacOS.
                  – Marslo
                  May 10 at 8:30
















                I've been trying to figure out how to do this for literally years XD
                – Bryson S.
                Dec 12 '16 at 6:33




                I've been trying to figure out how to do this for literally years XD
                – Bryson S.
                Dec 12 '16 at 6:33












                Invaluable command. Thanks.
                – Nik-Lz
                Dec 31 '16 at 21:57




                Invaluable command. Thanks.
                – Nik-Lz
                Dec 31 '16 at 21:57




                1




                1




                won't work in ubuntu 16.04
                – Kasun Siyambalapitiya
                Aug 16 '17 at 18:31




                won't work in ubuntu 16.04
                – Kasun Siyambalapitiya
                Aug 16 '17 at 18:31




                1




                1




                @KasunSiyambalapitiya It does work on my Ubuntu 16.04.3 LTS with a fresh install and nothing special installed.
                – WinEunuuchs2Unix
                Feb 25 at 18:00




                @KasunSiyambalapitiya It does work on my Ubuntu 16.04.3 LTS with a fresh install and nothing special installed.
                – WinEunuuchs2Unix
                Feb 25 at 18:00




                1




                1




                alias open="nautilus", and you can using $ open <PATH_HERE> like the MacOS.
                – Marslo
                May 10 at 8:30




                alias open="nautilus", and you can using $ open <PATH_HERE> like the MacOS.
                – Marslo
                May 10 at 8:30













                13














                You can also do gnome-open .. gnome-open is similar to open on Mac which tries to open the file using the best matching application. By default, gnome-open . on Ubuntu will open the current directory in Nautilus.



                There is an open command in Ubuntu as well but it does not work in this case.






                share|improve this answer

















                • 4




                  In Ubuntu 16.04 it isn't installed by default: "The program 'gnome-open' is currently not installed. You can install it by typing: sudo apt install libgnome2-bin"
                  – WinEunuuchs2Unix
                  Feb 25 at 17:59
















                13














                You can also do gnome-open .. gnome-open is similar to open on Mac which tries to open the file using the best matching application. By default, gnome-open . on Ubuntu will open the current directory in Nautilus.



                There is an open command in Ubuntu as well but it does not work in this case.






                share|improve this answer

















                • 4




                  In Ubuntu 16.04 it isn't installed by default: "The program 'gnome-open' is currently not installed. You can install it by typing: sudo apt install libgnome2-bin"
                  – WinEunuuchs2Unix
                  Feb 25 at 17:59














                13












                13








                13






                You can also do gnome-open .. gnome-open is similar to open on Mac which tries to open the file using the best matching application. By default, gnome-open . on Ubuntu will open the current directory in Nautilus.



                There is an open command in Ubuntu as well but it does not work in this case.






                share|improve this answer












                You can also do gnome-open .. gnome-open is similar to open on Mac which tries to open the file using the best matching application. By default, gnome-open . on Ubuntu will open the current directory in Nautilus.



                There is an open command in Ubuntu as well but it does not work in this case.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 28 '14 at 5:14









                wsaleem

                27328




                27328








                • 4




                  In Ubuntu 16.04 it isn't installed by default: "The program 'gnome-open' is currently not installed. You can install it by typing: sudo apt install libgnome2-bin"
                  – WinEunuuchs2Unix
                  Feb 25 at 17:59














                • 4




                  In Ubuntu 16.04 it isn't installed by default: "The program 'gnome-open' is currently not installed. You can install it by typing: sudo apt install libgnome2-bin"
                  – WinEunuuchs2Unix
                  Feb 25 at 17:59








                4




                4




                In Ubuntu 16.04 it isn't installed by default: "The program 'gnome-open' is currently not installed. You can install it by typing: sudo apt install libgnome2-bin"
                – WinEunuuchs2Unix
                Feb 25 at 17:59




                In Ubuntu 16.04 it isn't installed by default: "The program 'gnome-open' is currently not installed. You can install it by typing: sudo apt install libgnome2-bin"
                – WinEunuuchs2Unix
                Feb 25 at 17:59











                1














                You should use xdg-open . (or xdg-open <path>) which is way more generic.






                share|improve this answer


























                  1














                  You should use xdg-open . (or xdg-open <path>) which is way more generic.






                  share|improve this answer
























                    1












                    1








                    1






                    You should use xdg-open . (or xdg-open <path>) which is way more generic.






                    share|improve this answer












                    You should use xdg-open . (or xdg-open <path>) which is way more generic.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 1 at 19:39









                    Pierre Maoui

                    1314




                    1314























                        1














                        In order to avoid nasty warnings in my terminal I use nohup. To have it detached from my terminal I'm adding & at the end of my command. I also use the -w flag to open an new window.



                        nohup nautilus -w . &


                        Note that, nohup will create a file with warnings.



                        You can send that to /dev/null like this:



                        nohup nautilus -w . > /dev/null &





                        share|improve this answer




























                          1














                          In order to avoid nasty warnings in my terminal I use nohup. To have it detached from my terminal I'm adding & at the end of my command. I also use the -w flag to open an new window.



                          nohup nautilus -w . &


                          Note that, nohup will create a file with warnings.



                          You can send that to /dev/null like this:



                          nohup nautilus -w . > /dev/null &





                          share|improve this answer


























                            1












                            1








                            1






                            In order to avoid nasty warnings in my terminal I use nohup. To have it detached from my terminal I'm adding & at the end of my command. I also use the -w flag to open an new window.



                            nohup nautilus -w . &


                            Note that, nohup will create a file with warnings.



                            You can send that to /dev/null like this:



                            nohup nautilus -w . > /dev/null &





                            share|improve this answer














                            In order to avoid nasty warnings in my terminal I use nohup. To have it detached from my terminal I'm adding & at the end of my command. I also use the -w flag to open an new window.



                            nohup nautilus -w . &


                            Note that, nohup will create a file with warnings.



                            You can send that to /dev/null like this:



                            nohup nautilus -w . > /dev/null &






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Dec 15 at 16:59









                            Fabby

                            26.4k1360159




                            26.4k1360159










                            answered Dec 15 at 16:50









                            Julien B.

                            1114




                            1114























                                0














                                To open nautilus from terminal.



                                nautilus .



                                To open nautilus in the background and still use the terminal.



                                nohup nautilus . > /dev/null 2>&1 &



                                You can also make that an alias.



                                alias open='nohup nautilus . > /dev/null 2>&1 &'



                                You can also add that alias to .bash_aliases, to have it persistent.



                                echo "alias open='nohup nautilus . > /dev/null 2>&1 &'" >> .bash_aliases



                                So now, after restarting the terminal, you can just type open.






                                share|improve this answer










                                New contributor




                                Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                Check out our Code of Conduct.























                                  0














                                  To open nautilus from terminal.



                                  nautilus .



                                  To open nautilus in the background and still use the terminal.



                                  nohup nautilus . > /dev/null 2>&1 &



                                  You can also make that an alias.



                                  alias open='nohup nautilus . > /dev/null 2>&1 &'



                                  You can also add that alias to .bash_aliases, to have it persistent.



                                  echo "alias open='nohup nautilus . > /dev/null 2>&1 &'" >> .bash_aliases



                                  So now, after restarting the terminal, you can just type open.






                                  share|improve this answer










                                  New contributor




                                  Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                  Check out our Code of Conduct.





















                                    0












                                    0








                                    0






                                    To open nautilus from terminal.



                                    nautilus .



                                    To open nautilus in the background and still use the terminal.



                                    nohup nautilus . > /dev/null 2>&1 &



                                    You can also make that an alias.



                                    alias open='nohup nautilus . > /dev/null 2>&1 &'



                                    You can also add that alias to .bash_aliases, to have it persistent.



                                    echo "alias open='nohup nautilus . > /dev/null 2>&1 &'" >> .bash_aliases



                                    So now, after restarting the terminal, you can just type open.






                                    share|improve this answer










                                    New contributor




                                    Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.









                                    To open nautilus from terminal.



                                    nautilus .



                                    To open nautilus in the background and still use the terminal.



                                    nohup nautilus . > /dev/null 2>&1 &



                                    You can also make that an alias.



                                    alias open='nohup nautilus . > /dev/null 2>&1 &'



                                    You can also add that alias to .bash_aliases, to have it persistent.



                                    echo "alias open='nohup nautilus . > /dev/null 2>&1 &'" >> .bash_aliases



                                    So now, after restarting the terminal, you can just type open.







                                    share|improve this answer










                                    New contributor




                                    Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.









                                    share|improve this answer



                                    share|improve this answer








                                    edited Dec 24 at 8:07





















                                    New contributor




                                    Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.









                                    answered Dec 24 at 8:01









                                    Laurentiu Nic. Alexandrescu

                                    11




                                    11




                                    New contributor




                                    Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.





                                    New contributor





                                    Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.






                                    Laurentiu Nic. Alexandrescu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Ask Ubuntu!


                                        • 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%2faskubuntu.com%2fquestions%2f226755%2fhow-to-open-nautilus-at-current-command-line-directory%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

                                        flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                                        Mangá

                                        Eduardo VII do Reino Unido