Change PS1 in .bashrc so that the following directory path is shown:

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











up vote
0
down vote

favorite












A little background:



I am running Windows 10, have installed git bash, and created the .bashrc file.



Right now in my .bashrc, I have the following line:



PS1='w> '



So suppose I am on my desktop, and there is a folder called test. In git bash, it would show this:



~/Desktop/Test> (enter command here)



In my cmd, it would show:



C:UsersJohnDesktopTest> (enter command here)



I like the cmd path that it shows, and was wondering if it is possible to show this path instead of the one git bash shows, by modifying the PS1.







share|improve this question


























    up vote
    0
    down vote

    favorite












    A little background:



    I am running Windows 10, have installed git bash, and created the .bashrc file.



    Right now in my .bashrc, I have the following line:



    PS1='w> '



    So suppose I am on my desktop, and there is a folder called test. In git bash, it would show this:



    ~/Desktop/Test> (enter command here)



    In my cmd, it would show:



    C:UsersJohnDesktopTest> (enter command here)



    I like the cmd path that it shows, and was wondering if it is possible to show this path instead of the one git bash shows, by modifying the PS1.







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      A little background:



      I am running Windows 10, have installed git bash, and created the .bashrc file.



      Right now in my .bashrc, I have the following line:



      PS1='w> '



      So suppose I am on my desktop, and there is a folder called test. In git bash, it would show this:



      ~/Desktop/Test> (enter command here)



      In my cmd, it would show:



      C:UsersJohnDesktopTest> (enter command here)



      I like the cmd path that it shows, and was wondering if it is possible to show this path instead of the one git bash shows, by modifying the PS1.







      share|improve this question














      A little background:



      I am running Windows 10, have installed git bash, and created the .bashrc file.



      Right now in my .bashrc, I have the following line:



      PS1='w> '



      So suppose I am on my desktop, and there is a folder called test. In git bash, it would show this:



      ~/Desktop/Test> (enter command here)



      In my cmd, it would show:



      C:UsersJohnDesktopTest> (enter command here)



      I like the cmd path that it shows, and was wondering if it is possible to show this path instead of the one git bash shows, by modifying the PS1.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 15 at 0:06









      Jeff Schaller

      31.8k848109




      31.8k848109










      asked Jan 14 at 23:17









      K Split X

      288312




      288312




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          That seems not possible with w or W but you can do this:



          PS1='$PWD> '





          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: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f417133%2fchange-ps1-in-bashrc-so-that-the-following-directory-path-is-shown%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            That seems not possible with w or W but you can do this:



            PS1='$PWD> '





            share|improve this answer
























              up vote
              0
              down vote



              accepted










              That seems not possible with w or W but you can do this:



              PS1='$PWD> '





              share|improve this answer






















                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                That seems not possible with w or W but you can do this:



                PS1='$PWD> '





                share|improve this answer












                That seems not possible with w or W but you can do this:



                PS1='$PWD> '






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 14 at 23:39









                Hauke Laging

                53.4k1282130




                53.4k1282130






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f417133%2fchange-ps1-in-bashrc-so-that-the-following-directory-path-is-shown%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay