Mac Equivalent to Windows CMD f8












2














In Windows if I entered several commands and built up a little history, I could execute previous commands by typing a prefix at the command line and pressing F8 (Windows Keyboard shortcuts) to cycle through all commands in my history matching that prefix. Is there any equivalent in MacOS?





By way of example If I sequentially executed these commands



dir .
echo IgnoreThis
dir /b %TEMP%
dir /s .
dir /b %USERPROFILE%
echo IgnoreThis


If I then entered



dir /bF8



I would first receive an autocompletion to



dir /b %TEMP%


and if I pressed F8 again it would autocomplete to



dir /b %USERPROFILE%


For another example if I instead entered



dirF8



For the first, second, and third times I pressed F8 I would get



dir .
dir /b %TEMP%
dir /s .









share|improve this question



























    2














    In Windows if I entered several commands and built up a little history, I could execute previous commands by typing a prefix at the command line and pressing F8 (Windows Keyboard shortcuts) to cycle through all commands in my history matching that prefix. Is there any equivalent in MacOS?





    By way of example If I sequentially executed these commands



    dir .
    echo IgnoreThis
    dir /b %TEMP%
    dir /s .
    dir /b %USERPROFILE%
    echo IgnoreThis


    If I then entered



    dir /bF8



    I would first receive an autocompletion to



    dir /b %TEMP%


    and if I pressed F8 again it would autocomplete to



    dir /b %USERPROFILE%


    For another example if I instead entered



    dirF8



    For the first, second, and third times I pressed F8 I would get



    dir .
    dir /b %TEMP%
    dir /s .









    share|improve this question

























      2












      2








      2







      In Windows if I entered several commands and built up a little history, I could execute previous commands by typing a prefix at the command line and pressing F8 (Windows Keyboard shortcuts) to cycle through all commands in my history matching that prefix. Is there any equivalent in MacOS?





      By way of example If I sequentially executed these commands



      dir .
      echo IgnoreThis
      dir /b %TEMP%
      dir /s .
      dir /b %USERPROFILE%
      echo IgnoreThis


      If I then entered



      dir /bF8



      I would first receive an autocompletion to



      dir /b %TEMP%


      and if I pressed F8 again it would autocomplete to



      dir /b %USERPROFILE%


      For another example if I instead entered



      dirF8



      For the first, second, and third times I pressed F8 I would get



      dir .
      dir /b %TEMP%
      dir /s .









      share|improve this question













      In Windows if I entered several commands and built up a little history, I could execute previous commands by typing a prefix at the command line and pressing F8 (Windows Keyboard shortcuts) to cycle through all commands in my history matching that prefix. Is there any equivalent in MacOS?





      By way of example If I sequentially executed these commands



      dir .
      echo IgnoreThis
      dir /b %TEMP%
      dir /s .
      dir /b %USERPROFILE%
      echo IgnoreThis


      If I then entered



      dir /bF8



      I would first receive an autocompletion to



      dir /b %TEMP%


      and if I pressed F8 again it would autocomplete to



      dir /b %USERPROFILE%


      For another example if I instead entered



      dirF8



      For the first, second, and third times I pressed F8 I would get



      dir .
      dir /b %TEMP%
      dir /s .






      terminal keyboard command-line






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 5 hours ago









      jxramosjxramos

      1336




      1336






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Add this to your ~/.inputrc:



          # ↑
          "e[A":history-search-backward
          # ↓
          "e[B":history-search-forward

          # Try to stay at the same the cursor position when moving through the history.
          set history-preserve-point on





          share|improve this answer








          New contributor




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


















          • Also some useful options: gist.github.com/so-lit/c6b3661f67929fd0851ce4627e579c55
            – Yarik
            5 hours ago










          • Spot on, just what I needed! I'm back in business, thanks a bunch.
            – jxramos
            1 hour ago



















          1














          You may find that the Mac shell (called BASH, one of many Unix shells) is quite a bit more powerful than the Windows DOS/Powershell prompt.



          Briefly yes but autocomplete works very differently on the Mac and follows Unix shell conventions in place long before Windows/DOS was a gleam in Bill Gates eye.



          The up and down arrows will scroll backwards and forwards through the commands you have already entered. And even if you quit out of terminal all that history is remembered across sessions. Well not back to the beginning of time but BASH remembers a substantial history of commands.



          You can string multiple commands together with "&&" :



          cd /users/steve/desktop && rem picture.jpg


          That will CD to my user profile and then delete a file called picture.jpg



          Books (literally) have been written on the BASH shell and a little searching around the internet will come up with quite a lot of information on navigating, using, programming/scripting. if you don't specify the BASH shell on macOS you'll get a lot of Linux results which are generally applicable but many of the commands are different.



          If you are really interested in geeking out you can change to a different shell, there are several built-in, or another terminal program that has more features than the one that comes with macOS. Finding and using said options will be left up to you in the spirit of exploration.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "118"
            };
            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: 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%2fapple.stackexchange.com%2fquestions%2f347869%2fmac-equivalent-to-windows-cmd-f8%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Add this to your ~/.inputrc:



            # ↑
            "e[A":history-search-backward
            # ↓
            "e[B":history-search-forward

            # Try to stay at the same the cursor position when moving through the history.
            set history-preserve-point on





            share|improve this answer








            New contributor




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


















            • Also some useful options: gist.github.com/so-lit/c6b3661f67929fd0851ce4627e579c55
              – Yarik
              5 hours ago










            • Spot on, just what I needed! I'm back in business, thanks a bunch.
              – jxramos
              1 hour ago
















            2














            Add this to your ~/.inputrc:



            # ↑
            "e[A":history-search-backward
            # ↓
            "e[B":history-search-forward

            # Try to stay at the same the cursor position when moving through the history.
            set history-preserve-point on





            share|improve this answer








            New contributor




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


















            • Also some useful options: gist.github.com/so-lit/c6b3661f67929fd0851ce4627e579c55
              – Yarik
              5 hours ago










            • Spot on, just what I needed! I'm back in business, thanks a bunch.
              – jxramos
              1 hour ago














            2












            2








            2






            Add this to your ~/.inputrc:



            # ↑
            "e[A":history-search-backward
            # ↓
            "e[B":history-search-forward

            # Try to stay at the same the cursor position when moving through the history.
            set history-preserve-point on





            share|improve this answer








            New contributor




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









            Add this to your ~/.inputrc:



            # ↑
            "e[A":history-search-backward
            # ↓
            "e[B":history-search-forward

            # Try to stay at the same the cursor position when moving through the history.
            set history-preserve-point on






            share|improve this answer








            New contributor




            Yarik 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






            New contributor




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









            answered 5 hours ago









            YarikYarik

            561




            561




            New contributor




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





            New contributor





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






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












            • Also some useful options: gist.github.com/so-lit/c6b3661f67929fd0851ce4627e579c55
              – Yarik
              5 hours ago










            • Spot on, just what I needed! I'm back in business, thanks a bunch.
              – jxramos
              1 hour ago


















            • Also some useful options: gist.github.com/so-lit/c6b3661f67929fd0851ce4627e579c55
              – Yarik
              5 hours ago










            • Spot on, just what I needed! I'm back in business, thanks a bunch.
              – jxramos
              1 hour ago
















            Also some useful options: gist.github.com/so-lit/c6b3661f67929fd0851ce4627e579c55
            – Yarik
            5 hours ago




            Also some useful options: gist.github.com/so-lit/c6b3661f67929fd0851ce4627e579c55
            – Yarik
            5 hours ago












            Spot on, just what I needed! I'm back in business, thanks a bunch.
            – jxramos
            1 hour ago




            Spot on, just what I needed! I'm back in business, thanks a bunch.
            – jxramos
            1 hour ago













            1














            You may find that the Mac shell (called BASH, one of many Unix shells) is quite a bit more powerful than the Windows DOS/Powershell prompt.



            Briefly yes but autocomplete works very differently on the Mac and follows Unix shell conventions in place long before Windows/DOS was a gleam in Bill Gates eye.



            The up and down arrows will scroll backwards and forwards through the commands you have already entered. And even if you quit out of terminal all that history is remembered across sessions. Well not back to the beginning of time but BASH remembers a substantial history of commands.



            You can string multiple commands together with "&&" :



            cd /users/steve/desktop && rem picture.jpg


            That will CD to my user profile and then delete a file called picture.jpg



            Books (literally) have been written on the BASH shell and a little searching around the internet will come up with quite a lot of information on navigating, using, programming/scripting. if you don't specify the BASH shell on macOS you'll get a lot of Linux results which are generally applicable but many of the commands are different.



            If you are really interested in geeking out you can change to a different shell, there are several built-in, or another terminal program that has more features than the one that comes with macOS. Finding and using said options will be left up to you in the spirit of exploration.






            share|improve this answer


























              1














              You may find that the Mac shell (called BASH, one of many Unix shells) is quite a bit more powerful than the Windows DOS/Powershell prompt.



              Briefly yes but autocomplete works very differently on the Mac and follows Unix shell conventions in place long before Windows/DOS was a gleam in Bill Gates eye.



              The up and down arrows will scroll backwards and forwards through the commands you have already entered. And even if you quit out of terminal all that history is remembered across sessions. Well not back to the beginning of time but BASH remembers a substantial history of commands.



              You can string multiple commands together with "&&" :



              cd /users/steve/desktop && rem picture.jpg


              That will CD to my user profile and then delete a file called picture.jpg



              Books (literally) have been written on the BASH shell and a little searching around the internet will come up with quite a lot of information on navigating, using, programming/scripting. if you don't specify the BASH shell on macOS you'll get a lot of Linux results which are generally applicable but many of the commands are different.



              If you are really interested in geeking out you can change to a different shell, there are several built-in, or another terminal program that has more features than the one that comes with macOS. Finding and using said options will be left up to you in the spirit of exploration.






              share|improve this answer
























                1












                1








                1






                You may find that the Mac shell (called BASH, one of many Unix shells) is quite a bit more powerful than the Windows DOS/Powershell prompt.



                Briefly yes but autocomplete works very differently on the Mac and follows Unix shell conventions in place long before Windows/DOS was a gleam in Bill Gates eye.



                The up and down arrows will scroll backwards and forwards through the commands you have already entered. And even if you quit out of terminal all that history is remembered across sessions. Well not back to the beginning of time but BASH remembers a substantial history of commands.



                You can string multiple commands together with "&&" :



                cd /users/steve/desktop && rem picture.jpg


                That will CD to my user profile and then delete a file called picture.jpg



                Books (literally) have been written on the BASH shell and a little searching around the internet will come up with quite a lot of information on navigating, using, programming/scripting. if you don't specify the BASH shell on macOS you'll get a lot of Linux results which are generally applicable but many of the commands are different.



                If you are really interested in geeking out you can change to a different shell, there are several built-in, or another terminal program that has more features than the one that comes with macOS. Finding and using said options will be left up to you in the spirit of exploration.






                share|improve this answer












                You may find that the Mac shell (called BASH, one of many Unix shells) is quite a bit more powerful than the Windows DOS/Powershell prompt.



                Briefly yes but autocomplete works very differently on the Mac and follows Unix shell conventions in place long before Windows/DOS was a gleam in Bill Gates eye.



                The up and down arrows will scroll backwards and forwards through the commands you have already entered. And even if you quit out of terminal all that history is remembered across sessions. Well not back to the beginning of time but BASH remembers a substantial history of commands.



                You can string multiple commands together with "&&" :



                cd /users/steve/desktop && rem picture.jpg


                That will CD to my user profile and then delete a file called picture.jpg



                Books (literally) have been written on the BASH shell and a little searching around the internet will come up with quite a lot of information on navigating, using, programming/scripting. if you don't specify the BASH shell on macOS you'll get a lot of Linux results which are generally applicable but many of the commands are different.



                If you are really interested in geeking out you can change to a different shell, there are several built-in, or another terminal program that has more features than the one that comes with macOS. Finding and using said options will be left up to you in the spirit of exploration.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 5 hours ago









                Steve ChambersSteve Chambers

                13.8k21538




                13.8k21538






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Different!


                    • 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%2fapple.stackexchange.com%2fquestions%2f347869%2fmac-equivalent-to-windows-cmd-f8%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

                    Accessing regular linux commands in Huawei's Dopra Linux

                    Can't connect RFCOMM socket: Host is down

                    Kernel panic - not syncing: Fatal Exception in Interrupt