Did you mean this command instead? (how to reply to this)












2















Suppose I entered the following thing into terminal:



wgets "link"



I will get the response:




No command 'wgets' found, did you mean:
Command 'wget' from package 'wget' (main)




I made a mistake, and the terminal warned me.



Is there a command that I can type after the terminal warned me, so that then it will execute the command above with what it thought it was?



For example:



->wgets "link"

->No command 'wgets' found, did you mean:
Command 'wget' from package 'wget' (main)

->yes (this command I am looking for ... is there one?)

-> executing wget "link"









share|improve this question




















  • 1





    This is not a generic "shell" question. What happens in this circumstance varies from shell to shell. The Z shell differing from the Bourne Again shell differing from the Korn shell, for example. It also depends from what shell extensions are installed. Your question is describing the behaviour of a particular shell with a particular extension.

    – JdeBP
    Jun 23 '17 at 20:39











  • I don't have much knowledge of Linux, so feel free to remove tags you don't think are valid here

    – K Split X
    Jun 23 '17 at 20:40






  • 1





    In most cases, people take advantage of the respective shells history file here. Use the Up Arrow to type a repeat of the command, remove the mistake, and continue

    – eyoung100
    Jun 23 '17 at 20:46











  • @eyoung100 I'm aware of that, that's why I've been doing until now :P

    – K Split X
    Jun 23 '17 at 20:51






  • 3





    I think you want thefuck. ;) I wouldn't use it in Production in a million years, but it's funny.

    – Wildcard
    Jun 23 '17 at 22:19


















2















Suppose I entered the following thing into terminal:



wgets "link"



I will get the response:




No command 'wgets' found, did you mean:
Command 'wget' from package 'wget' (main)




I made a mistake, and the terminal warned me.



Is there a command that I can type after the terminal warned me, so that then it will execute the command above with what it thought it was?



For example:



->wgets "link"

->No command 'wgets' found, did you mean:
Command 'wget' from package 'wget' (main)

->yes (this command I am looking for ... is there one?)

-> executing wget "link"









share|improve this question




















  • 1





    This is not a generic "shell" question. What happens in this circumstance varies from shell to shell. The Z shell differing from the Bourne Again shell differing from the Korn shell, for example. It also depends from what shell extensions are installed. Your question is describing the behaviour of a particular shell with a particular extension.

    – JdeBP
    Jun 23 '17 at 20:39











  • I don't have much knowledge of Linux, so feel free to remove tags you don't think are valid here

    – K Split X
    Jun 23 '17 at 20:40






  • 1





    In most cases, people take advantage of the respective shells history file here. Use the Up Arrow to type a repeat of the command, remove the mistake, and continue

    – eyoung100
    Jun 23 '17 at 20:46











  • @eyoung100 I'm aware of that, that's why I've been doing until now :P

    – K Split X
    Jun 23 '17 at 20:51






  • 3





    I think you want thefuck. ;) I wouldn't use it in Production in a million years, but it's funny.

    – Wildcard
    Jun 23 '17 at 22:19
















2












2








2








Suppose I entered the following thing into terminal:



wgets "link"



I will get the response:




No command 'wgets' found, did you mean:
Command 'wget' from package 'wget' (main)




I made a mistake, and the terminal warned me.



Is there a command that I can type after the terminal warned me, so that then it will execute the command above with what it thought it was?



For example:



->wgets "link"

->No command 'wgets' found, did you mean:
Command 'wget' from package 'wget' (main)

->yes (this command I am looking for ... is there one?)

-> executing wget "link"









share|improve this question
















Suppose I entered the following thing into terminal:



wgets "link"



I will get the response:




No command 'wgets' found, did you mean:
Command 'wget' from package 'wget' (main)




I made a mistake, and the terminal warned me.



Is there a command that I can type after the terminal warned me, so that then it will execute the command above with what it thought it was?



For example:



->wgets "link"

->No command 'wgets' found, did you mean:
Command 'wget' from package 'wget' (main)

->yes (this command I am looking for ... is there one?)

-> executing wget "link"






bash shell command-line command autocorrection






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 25 '17 at 23:33









Gilles

531k12810651592




531k12810651592










asked Jun 23 '17 at 20:27









K Split XK Split X

3381414




3381414








  • 1





    This is not a generic "shell" question. What happens in this circumstance varies from shell to shell. The Z shell differing from the Bourne Again shell differing from the Korn shell, for example. It also depends from what shell extensions are installed. Your question is describing the behaviour of a particular shell with a particular extension.

    – JdeBP
    Jun 23 '17 at 20:39











  • I don't have much knowledge of Linux, so feel free to remove tags you don't think are valid here

    – K Split X
    Jun 23 '17 at 20:40






  • 1





    In most cases, people take advantage of the respective shells history file here. Use the Up Arrow to type a repeat of the command, remove the mistake, and continue

    – eyoung100
    Jun 23 '17 at 20:46











  • @eyoung100 I'm aware of that, that's why I've been doing until now :P

    – K Split X
    Jun 23 '17 at 20:51






  • 3





    I think you want thefuck. ;) I wouldn't use it in Production in a million years, but it's funny.

    – Wildcard
    Jun 23 '17 at 22:19
















  • 1





    This is not a generic "shell" question. What happens in this circumstance varies from shell to shell. The Z shell differing from the Bourne Again shell differing from the Korn shell, for example. It also depends from what shell extensions are installed. Your question is describing the behaviour of a particular shell with a particular extension.

    – JdeBP
    Jun 23 '17 at 20:39











  • I don't have much knowledge of Linux, so feel free to remove tags you don't think are valid here

    – K Split X
    Jun 23 '17 at 20:40






  • 1





    In most cases, people take advantage of the respective shells history file here. Use the Up Arrow to type a repeat of the command, remove the mistake, and continue

    – eyoung100
    Jun 23 '17 at 20:46











  • @eyoung100 I'm aware of that, that's why I've been doing until now :P

    – K Split X
    Jun 23 '17 at 20:51






  • 3





    I think you want thefuck. ;) I wouldn't use it in Production in a million years, but it's funny.

    – Wildcard
    Jun 23 '17 at 22:19










1




1





This is not a generic "shell" question. What happens in this circumstance varies from shell to shell. The Z shell differing from the Bourne Again shell differing from the Korn shell, for example. It also depends from what shell extensions are installed. Your question is describing the behaviour of a particular shell with a particular extension.

– JdeBP
Jun 23 '17 at 20:39





This is not a generic "shell" question. What happens in this circumstance varies from shell to shell. The Z shell differing from the Bourne Again shell differing from the Korn shell, for example. It also depends from what shell extensions are installed. Your question is describing the behaviour of a particular shell with a particular extension.

– JdeBP
Jun 23 '17 at 20:39













I don't have much knowledge of Linux, so feel free to remove tags you don't think are valid here

– K Split X
Jun 23 '17 at 20:40





I don't have much knowledge of Linux, so feel free to remove tags you don't think are valid here

– K Split X
Jun 23 '17 at 20:40




1




1





In most cases, people take advantage of the respective shells history file here. Use the Up Arrow to type a repeat of the command, remove the mistake, and continue

– eyoung100
Jun 23 '17 at 20:46





In most cases, people take advantage of the respective shells history file here. Use the Up Arrow to type a repeat of the command, remove the mistake, and continue

– eyoung100
Jun 23 '17 at 20:46













@eyoung100 I'm aware of that, that's why I've been doing until now :P

– K Split X
Jun 23 '17 at 20:51





@eyoung100 I'm aware of that, that's why I've been doing until now :P

– K Split X
Jun 23 '17 at 20:51




3




3





I think you want thefuck. ;) I wouldn't use it in Production in a million years, but it's funny.

– Wildcard
Jun 23 '17 at 22:19







I think you want thefuck. ;) I wouldn't use it in Production in a million years, but it's funny.

– Wildcard
Jun 23 '17 at 22:19












3 Answers
3






active

oldest

votes


















1














Switch to zsh (installed by default on macOS and available as a package on all major Linux distributions, *BSD, and software collections for other Unix-like operating systems). It has autocorrect for command names.



% wgets
zsh: correct 'wgets' to 'wget' [nyae]? y
wget: missing URL






share|improve this answer































    4














    In Bash you can use search and replace to modify the previously run incorrect command. From your example:



    ->wgets "link"

    ->No command 'wgets' found, did you mean:
    Command 'wget' from package 'wget' (main)

    ->^wgets^wget^


    The wgets will be replaced with wget and the command executed.



    To facilitate this on a command from earlier in the history list:



    ->!wgets:s/wgets/wget/


    From man 3 history under Event Designators:



    !string
    Refer to the most recent command starting with string.

    ...

    ^string1^string2^
    Quick Substitution. Repeat the last command, replacing string1
    with string2. Equivalent to ''!!:s/string1/string2/''.





    share|improve this answer

































      1














      As Wildcard already suggested install thefuck and then alias "yes" to it by adding the following lines to your .bash_profile, .bashrc or .zshrc:



      eval $(thefuck --alias)
      alias yes="fuck"


      ->wgets "link"

      ->No command 'wgets' found, did you mean:
      Command 'wget' from package 'wget' (main)

      ->yes

      -> wget "link" [enter/↑/↓/ctrl+c]

      -> Downloading...





      share|improve this answer








      New contributor




      Jannis Hell 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: "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',
        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%2funix.stackexchange.com%2fquestions%2f373064%2fdid-you-mean-this-command-instead-how-to-reply-to-this%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1














        Switch to zsh (installed by default on macOS and available as a package on all major Linux distributions, *BSD, and software collections for other Unix-like operating systems). It has autocorrect for command names.



        % wgets
        zsh: correct 'wgets' to 'wget' [nyae]? y
        wget: missing URL






        share|improve this answer




























          1














          Switch to zsh (installed by default on macOS and available as a package on all major Linux distributions, *BSD, and software collections for other Unix-like operating systems). It has autocorrect for command names.



          % wgets
          zsh: correct 'wgets' to 'wget' [nyae]? y
          wget: missing URL






          share|improve this answer


























            1












            1








            1







            Switch to zsh (installed by default on macOS and available as a package on all major Linux distributions, *BSD, and software collections for other Unix-like operating systems). It has autocorrect for command names.



            % wgets
            zsh: correct 'wgets' to 'wget' [nyae]? y
            wget: missing URL






            share|improve this answer













            Switch to zsh (installed by default on macOS and available as a package on all major Linux distributions, *BSD, and software collections for other Unix-like operating systems). It has autocorrect for command names.



            % wgets
            zsh: correct 'wgets' to 'wget' [nyae]? y
            wget: missing URL







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 25 '17 at 23:33









            GillesGilles

            531k12810651592




            531k12810651592

























                4














                In Bash you can use search and replace to modify the previously run incorrect command. From your example:



                ->wgets "link"

                ->No command 'wgets' found, did you mean:
                Command 'wget' from package 'wget' (main)

                ->^wgets^wget^


                The wgets will be replaced with wget and the command executed.



                To facilitate this on a command from earlier in the history list:



                ->!wgets:s/wgets/wget/


                From man 3 history under Event Designators:



                !string
                Refer to the most recent command starting with string.

                ...

                ^string1^string2^
                Quick Substitution. Repeat the last command, replacing string1
                with string2. Equivalent to ''!!:s/string1/string2/''.





                share|improve this answer






























                  4














                  In Bash you can use search and replace to modify the previously run incorrect command. From your example:



                  ->wgets "link"

                  ->No command 'wgets' found, did you mean:
                  Command 'wget' from package 'wget' (main)

                  ->^wgets^wget^


                  The wgets will be replaced with wget and the command executed.



                  To facilitate this on a command from earlier in the history list:



                  ->!wgets:s/wgets/wget/


                  From man 3 history under Event Designators:



                  !string
                  Refer to the most recent command starting with string.

                  ...

                  ^string1^string2^
                  Quick Substitution. Repeat the last command, replacing string1
                  with string2. Equivalent to ''!!:s/string1/string2/''.





                  share|improve this answer




























                    4












                    4








                    4







                    In Bash you can use search and replace to modify the previously run incorrect command. From your example:



                    ->wgets "link"

                    ->No command 'wgets' found, did you mean:
                    Command 'wget' from package 'wget' (main)

                    ->^wgets^wget^


                    The wgets will be replaced with wget and the command executed.



                    To facilitate this on a command from earlier in the history list:



                    ->!wgets:s/wgets/wget/


                    From man 3 history under Event Designators:



                    !string
                    Refer to the most recent command starting with string.

                    ...

                    ^string1^string2^
                    Quick Substitution. Repeat the last command, replacing string1
                    with string2. Equivalent to ''!!:s/string1/string2/''.





                    share|improve this answer















                    In Bash you can use search and replace to modify the previously run incorrect command. From your example:



                    ->wgets "link"

                    ->No command 'wgets' found, did you mean:
                    Command 'wget' from package 'wget' (main)

                    ->^wgets^wget^


                    The wgets will be replaced with wget and the command executed.



                    To facilitate this on a command from earlier in the history list:



                    ->!wgets:s/wgets/wget/


                    From man 3 history under Event Designators:



                    !string
                    Refer to the most recent command starting with string.

                    ...

                    ^string1^string2^
                    Quick Substitution. Repeat the last command, replacing string1
                    with string2. Equivalent to ''!!:s/string1/string2/''.






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jun 23 '17 at 21:49

























                    answered Jun 23 '17 at 21:29









                    Timothy MartinTimothy Martin

                    5,2742129




                    5,2742129























                        1














                        As Wildcard already suggested install thefuck and then alias "yes" to it by adding the following lines to your .bash_profile, .bashrc or .zshrc:



                        eval $(thefuck --alias)
                        alias yes="fuck"


                        ->wgets "link"

                        ->No command 'wgets' found, did you mean:
                        Command 'wget' from package 'wget' (main)

                        ->yes

                        -> wget "link" [enter/↑/↓/ctrl+c]

                        -> Downloading...





                        share|improve this answer








                        New contributor




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

























                          1














                          As Wildcard already suggested install thefuck and then alias "yes" to it by adding the following lines to your .bash_profile, .bashrc or .zshrc:



                          eval $(thefuck --alias)
                          alias yes="fuck"


                          ->wgets "link"

                          ->No command 'wgets' found, did you mean:
                          Command 'wget' from package 'wget' (main)

                          ->yes

                          -> wget "link" [enter/↑/↓/ctrl+c]

                          -> Downloading...





                          share|improve this answer








                          New contributor




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























                            1












                            1








                            1







                            As Wildcard already suggested install thefuck and then alias "yes" to it by adding the following lines to your .bash_profile, .bashrc or .zshrc:



                            eval $(thefuck --alias)
                            alias yes="fuck"


                            ->wgets "link"

                            ->No command 'wgets' found, did you mean:
                            Command 'wget' from package 'wget' (main)

                            ->yes

                            -> wget "link" [enter/↑/↓/ctrl+c]

                            -> Downloading...





                            share|improve this answer








                            New contributor




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










                            As Wildcard already suggested install thefuck and then alias "yes" to it by adding the following lines to your .bash_profile, .bashrc or .zshrc:



                            eval $(thefuck --alias)
                            alias yes="fuck"


                            ->wgets "link"

                            ->No command 'wgets' found, did you mean:
                            Command 'wget' from package 'wget' (main)

                            ->yes

                            -> wget "link" [enter/↑/↓/ctrl+c]

                            -> Downloading...






                            share|improve this answer








                            New contributor




                            Jannis Hell 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




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









                            answered 13 hours ago









                            Jannis HellJannis Hell

                            112




                            112




                            New contributor




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





                            New contributor





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






                            Jannis Hell 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 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.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f373064%2fdid-you-mean-this-command-instead-how-to-reply-to-this%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

                                Histoire des bourses de valeurs

                                Why is there Russian traffic in my log files?

                                Rename multiple files to decrement number in file name?