Cool idea. For those systems where you don't have the option of adding a 3rd party tool, it's probably worth knowing some of the standard bash shortcuts. The easy to remember ones are: !^ - the first argument from the previous command !$ - the last argument from the previous command !* - all of the arguments from the previous command !! - the entire previous command For example: $ apt-get install foo # Crap $ sudo !!
Typo correction is useful too. ^foo^bar git brnch ^r^ra This works on all Unix machines
The Fuck – Correct your previous console command
131–140 of 173 posts
Re: The Fuck – Correct your previous console command
#132I'm going to go out on a limb here and suggest that you rename it "The Fix." Then you could type "fixit" or just "fix".
Re: The Fuck – Correct your previous console command
#133Earlier quoted context omitted.
American prudishness. There's nothing immature in swearing in and of itself.
> American prudishness Sounds like you need a review of: https://news.ycombinator.com/newsguidelines.html Or perhaps just some common decency ? If you want a tool / platform to take off, using the word 'fuck' is not the way to go.
Also:
http://www.whatthefuckshouldimakefordinner.com/
etc.
Re: The Fuck – Correct your previous console command
#134Cool idea. For those systems where you don't have the option of adding a 3rd party tool, it's probably worth knowing some of the standard bash shortcuts. The easy to remember ones are: !^ - the first argument from the previous command !$ - the last argument from the previous command !* - all of the arguments from the previous command !! - the entire previous command For example: $ apt-get install foo # Crap $ sudo !!
Let us not forget, also substitution regexs in bash... $ ls -l /tmp/foo ls: cannot access /tmp/foo: No such file or directory $ !:s/foo/bar -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar
$ ls -l /tmp/foo
ls: cannot access /tmp/foo: No such file or directory
$ ^foo^bar
-rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/barRe: The Fuck – Correct your previous console command
#135I will not let my coworkers see me typing expletives into terminal; much less if it is a woman. It is a nice idea, though. Will use it if it's called auto-correct or something.
Simply change the alias to something else: alias doh='$(thefuck $(fc -ln -1))'
Re: The Fuck – Correct your previous console command
#136Earlier quoted context omitted.
Yes, using the word "fuck" for this just strikes me as a bit immature.
American prudishness. There's nothing immature in swearing in and of itself.
Re: The Fuck – Correct your previous console command
#137alias WTFs="history | grep fuck | wc -l"
Re: The Fuck – Correct your previous console command
#138Earlier quoted context omitted.
> WTF means the same thing. That is no less vulgar. Vulgarity of expressions is not a function only of what the expression means, but of the acceptability of the expression itself in various social contexts. WTF is, generally, acceptable as not excessively vulgar in social contexts where expanding the last letter of the initialism into its referent would not be, but the reverse isn't true; WTF is pretty close, theref…
> "WTF is, generally, acceptable as not excessively vulgar in social contexts" Which social contexts? Social contexts where people don't know what "WTF" expands to? It's not even a "minced oath".
Re: The Fuck – Correct your previous console command
#139I thought the cardinal rule of sysadmins was "think before you press enter". This seems to discourage that mindset.
Re: The Fuck – Correct your previous console command
#140Earlier quoted context omitted.
Let us not forget, also substitution regexs in bash... $ ls -l /tmp/foo ls: cannot access /tmp/foo: No such file or directory $ !:s/foo/bar -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar
And the shorthand: $ ls -l /tmp/foo ls: cannot access /tmp/foo: No such file or directory $ ^foo^bar -rw-rw-r-- 1 user user 0 Apr 17 19:12 /tmp/bar
$ ls
hello_world hi_there_world
$ mv hello_world hello_everyone
$ !!:gs/hello/hi_there
mv hi_there_world hi_there_everyone
$ ls
hi_there_world hi_there_everyone