cd returns New line.?

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








up vote
0
down vote

favorite
1












enter image description here



I want to go to $ prompt? But how without having to [Enter] twice ?



cd .. works just fine and so doescd /







share|improve this question


























    up vote
    0
    down vote

    favorite
    1












    enter image description here



    I want to go to $ prompt? But how without having to [Enter] twice ?



    cd .. works just fine and so doescd /







    share|improve this question
























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      enter image description here



      I want to go to $ prompt? But how without having to [Enter] twice ?



      cd .. works just fine and so doescd /







      share|improve this question














      enter image description here



      I want to go to $ prompt? But how without having to [Enter] twice ?



      cd .. works just fine and so doescd /









      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 22 at 7:36









      Sergiy Kolodyazhnyy

      64.9k9129282




      64.9k9129282










      asked Apr 22 at 6:39









      Puneet Bapna

      163




      163




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          down vote













          This is because the character is considered an "escape" in the Bash shell.



          Take the following command:



          sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages


          We can instead rewrite this command like this:



          sudo apt-get install some-package some-other-package 
          yet-another-package oh-my-we-have-a-lot-of-packages
          and-still-another-package wow-so-many-packages


          Bash will interpret the to mean "read the next line as part of this one." In your case, you type cd , so Bash expects you to give it another line.



          If you want to go quickly back to your homedir (that is, ~), you can either use cd ~ or just plain cd.






          share|improve this answer



























            up vote
            4
            down vote













            With cd you have entered a cd command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.



            With cd alone (without ) you would go to your home directory, cd .. brings you to the parent directory of the current one, and cd / to the base directory '/'.






            share|improve this answer




















            • ` doesn't specifically imply newline. The ` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M character. With ` that modifies into newline. Similar example, echo "$HOME"` vs echo $HOME, where ` modifies meaning of $` from signifying a variable to literal $
              – Sergiy Kolodyazhnyy
              Apr 22 at 7:42










            • Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
              – Sergiy Kolodyazhnyy
              Apr 22 at 16:57










            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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f1027111%2fcd-returns-new-line%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote













            This is because the character is considered an "escape" in the Bash shell.



            Take the following command:



            sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages


            We can instead rewrite this command like this:



            sudo apt-get install some-package some-other-package 
            yet-another-package oh-my-we-have-a-lot-of-packages
            and-still-another-package wow-so-many-packages


            Bash will interpret the to mean "read the next line as part of this one." In your case, you type cd , so Bash expects you to give it another line.



            If you want to go quickly back to your homedir (that is, ~), you can either use cd ~ or just plain cd.






            share|improve this answer
























              up vote
              5
              down vote













              This is because the character is considered an "escape" in the Bash shell.



              Take the following command:



              sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages


              We can instead rewrite this command like this:



              sudo apt-get install some-package some-other-package 
              yet-another-package oh-my-we-have-a-lot-of-packages
              and-still-another-package wow-so-many-packages


              Bash will interpret the to mean "read the next line as part of this one." In your case, you type cd , so Bash expects you to give it another line.



              If you want to go quickly back to your homedir (that is, ~), you can either use cd ~ or just plain cd.






              share|improve this answer






















                up vote
                5
                down vote










                up vote
                5
                down vote









                This is because the character is considered an "escape" in the Bash shell.



                Take the following command:



                sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages


                We can instead rewrite this command like this:



                sudo apt-get install some-package some-other-package 
                yet-another-package oh-my-we-have-a-lot-of-packages
                and-still-another-package wow-so-many-packages


                Bash will interpret the to mean "read the next line as part of this one." In your case, you type cd , so Bash expects you to give it another line.



                If you want to go quickly back to your homedir (that is, ~), you can either use cd ~ or just plain cd.






                share|improve this answer












                This is because the character is considered an "escape" in the Bash shell.



                Take the following command:



                sudo apt-get install some-package some-other-package yet-another-package oh-my-we-have-a-lot-of-packages and-still-another-package wow-so-many-packages


                We can instead rewrite this command like this:



                sudo apt-get install some-package some-other-package 
                yet-another-package oh-my-we-have-a-lot-of-packages
                and-still-another-package wow-so-many-packages


                Bash will interpret the to mean "read the next line as part of this one." In your case, you type cd , so Bash expects you to give it another line.



                If you want to go quickly back to your homedir (that is, ~), you can either use cd ~ or just plain cd.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 22 at 6:42









                Kaz Wolfe

                25.5k1370131




                25.5k1370131






















                    up vote
                    4
                    down vote













                    With cd you have entered a cd command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.



                    With cd alone (without ) you would go to your home directory, cd .. brings you to the parent directory of the current one, and cd / to the base directory '/'.






                    share|improve this answer




















                    • ` doesn't specifically imply newline. The ` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M character. With ` that modifies into newline. Similar example, echo "$HOME"` vs echo $HOME, where ` modifies meaning of $` from signifying a variable to literal $
                      – Sergiy Kolodyazhnyy
                      Apr 22 at 7:42










                    • Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
                      – Sergiy Kolodyazhnyy
                      Apr 22 at 16:57














                    up vote
                    4
                    down vote













                    With cd you have entered a cd command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.



                    With cd alone (without ) you would go to your home directory, cd .. brings you to the parent directory of the current one, and cd / to the base directory '/'.






                    share|improve this answer




















                    • ` doesn't specifically imply newline. The ` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M character. With ` that modifies into newline. Similar example, echo "$HOME"` vs echo $HOME, where ` modifies meaning of $` from signifying a variable to literal $
                      – Sergiy Kolodyazhnyy
                      Apr 22 at 7:42










                    • Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
                      – Sergiy Kolodyazhnyy
                      Apr 22 at 16:57












                    up vote
                    4
                    down vote










                    up vote
                    4
                    down vote









                    With cd you have entered a cd command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.



                    With cd alone (without ) you would go to your home directory, cd .. brings you to the parent directory of the current one, and cd / to the base directory '/'.






                    share|improve this answer












                    With cd you have entered a cd command and the tells the shell that you want to continue your command on a new line. So it gives you a new line.



                    With cd alone (without ) you would go to your home directory, cd .. brings you to the parent directory of the current one, and cd / to the base directory '/'.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Apr 22 at 6:45









                    muclux

                    2,1231521




                    2,1231521











                    • ` doesn't specifically imply newline. The ` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M character. With ` that modifies into newline. Similar example, echo "$HOME"` vs echo $HOME, where ` modifies meaning of $` from signifying a variable to literal $
                      – Sergiy Kolodyazhnyy
                      Apr 22 at 7:42










                    • Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
                      – Sergiy Kolodyazhnyy
                      Apr 22 at 16:57
















                    • ` doesn't specifically imply newline. The ` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M character. With ` that modifies into newline. Similar example, echo "$HOME"` vs echo $HOME, where ` modifies meaning of $` from signifying a variable to literal $
                      – Sergiy Kolodyazhnyy
                      Apr 22 at 7:42










                    • Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
                      – Sergiy Kolodyazhnyy
                      Apr 22 at 16:57















                    ` doesn't specifically imply newline. The ` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M character. With ` that modifies into newline. Similar example, echo "$HOME"` vs echo $HOME, where ` modifies meaning of $` from signifying a variable to literal $
                    – Sergiy Kolodyazhnyy
                    Apr 22 at 7:42




                    ` doesn't specifically imply newline. The ` serves as an escape character, which modifies the meaning of whatever character/byte comes next. In this particular case it happened to be coming from Enter key, which normally means carriage return or ^M character. With ` that modifies into newline. Similar example, echo "$HOME"` vs echo $HOME, where ` modifies meaning of $` from signifying a variable to literal $
                    – Sergiy Kolodyazhnyy
                    Apr 22 at 7:42












                    Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
                    – Sergiy Kolodyazhnyy
                    Apr 22 at 16:57




                    Oops, stackexchange formatting messed up the comment. I was saying "The doesn't specifically imply newline.
                    – Sergiy Kolodyazhnyy
                    Apr 22 at 16:57

















                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1027111%2fcd-returns-new-line%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Which professions warranted travel in Medieval times?

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Trouble downloading packages list due to a “Hash sum mismatch” error