Live data from Hacker News

The Fuck – Correct your previous console command

github.com

141–150 of 173 posts

Re: The Fuck – Correct your previous console command

#141

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 !!

I use $_ all the time, since it's the last argument to the previous command [after expansion]. Example would be:

atom path/to/so[tab]/fi[tab] [return] git diff $_

Complete reference: https://www.gnu.org/software/bash/manual/html_node/Variable-...

See also: http://wiki.bash-hackers.org/syntax/shellvars

Re: The Fuck – Correct your previous console command

#142

Earlier quoted context omitted.

I'm not sure what difference you think gender makes, unless you think women are delicate flowers that must be sheltered from bad language, but I do agree that it would be better named something more office friendly. I'd suggest 'argh', 'grr' or 'gah'.

Profanity is (deliberately) uncomfortable to people who are not part of your in-group. Women are more likely to be/feel excluded from in-groups in technology workplaces.

> Women are more likely to be/feel excluded from in-groups in technology workplaces

... because people want to treat them differently, perhaps?

Re: The Fuck – Correct your previous console command

#143
"In one notorious incident, Warren added a DWIM feature to the command interpreter used at Xerox PARC. One day another hacker there typed delete $ to free up some disk space. (The editor there named backup files by appending $ to the original file name, so he was trying to delete any backup files left over from old editing sessions.) It happened that there weren't any editor backup files, so DWIM helpfully reported $ not found, assuming you meant 'delete *'." See http://www.catb.org/jargon/html/D/DWIM.html and also https://en.wikipedia.org/wiki/DWIM

Re: The Fuck – Correct your previous console command

#144

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 !!

I've been using "sudo !!" (which I pronounce as sudo bangbang in my head) for a while now, mostly with vim for editing stuff in /etc. It's very nifty. Another nifty tool is vi editing mode. You run "set -o vi", and now your shell takes vi modal editing commands. That along with Ctrl-r for reverse history search has made life in the shell so much easier. Bash has a ton of little stuff like that built in. Zsh has a few…

sudo !! is my favorite thing. I named my cat sudo bangbang.

Re: The Fuck – Correct your previous console command

#145

Earlier quoted context omitted.

I've been using "sudo !!" (which I pronounce as sudo bangbang in my head) for a while now, mostly with vim for editing stuff in /etc. It's very nifty. Another nifty tool is vi editing mode. You run "set -o vi", and now your shell takes vi modal editing commands. That along with Ctrl-r for reverse history search has made life in the shell so much easier. Bash has a ton of little stuff like that built in. Zsh has a few…

Probably my biggest overall timesaver has been: :w !sudo tee % If you neglected to sudo before making your changes.

Its much more easier to remember when you know how that actually works. Here is link explaining how that actually works:

http://stackoverflow.com/questions/2600783/how-does-the-vim-...

Re: The Fuck – Correct your previous console command

#146

Earlier quoted context omitted.

I'm not sure what difference you think gender makes, unless you think women are delicate flowers that must be sheltered from bad language, but I do agree that it would be better named something more office friendly. I'd suggest 'argh', 'grr' or 'gah'.

Profanity is (deliberately) uncomfortable to people who are not part of your in-group. Women are more likely to be/feel excluded from in-groups in technology workplaces.

If I specifically don't swear around a woman colleague, while I would usually swear around all my male colleagues, isn't that exclusionary? Wouldn't treating her the same as I treat everyone else be more inclusive?

Re: The Fuck – Correct your previous console command

#147
post #20
post #15

Amusing, but I would prefer something that would be able to automatically know what I was meaning to do and just do it without having to be vulgar.

Agreed. They could even sanitize it a little bit as 'wtf' or 'oops'.

There's already a "wtf" program, available in Macports and probably some other package managers. It has a database of internet acronyms, and otherwise it seems similar to commands like "apropos" and "whatis".

  ~> wtf is imnsho
  IMNSHO: in my not so humble opinion
  ~> wtf is cat
  SVK::Command::Cat(3pm)   - Output the file from depot
  cat(1)                   - concatenate and print files
  fc-cat(1)                - read font information cache files
  git-cat-file(1)          - Provide content or type and size information for repository objects
  ~> wtf is fuck
  fuck: nothing appropriate
http://cvsweb.netbsd.org/bsdweb.cgi/src/games/wtf/

Re: The Fuck – Correct your previous console command

#148

Earlier quoted context omitted.

I've been using "sudo !!" (which I pronounce as sudo bangbang in my head) for a while now, mostly with vim for editing stuff in /etc. It's very nifty. Another nifty tool is vi editing mode. You run "set -o vi", and now your shell takes vi modal editing commands. That along with Ctrl-r for reverse history search has made life in the shell so much easier. Bash has a ton of little stuff like that built in. Zsh has a few…

sudo !! is my favorite thing. I named my cat sudo bangbang.

I don't see the advantage over pressing up, C-a and typing sudo

Re: The Fuck – Correct your previous console command

#150
post #4

Not being 100% sure which command this will correct to is dangerous. Also the need for this is largely negated by a shell with autosuggestions.

Or syntax highlighting as found in fish, red if your command will not run, blue otherwise, params in blue. Duno I wish more shells had basic syntax highlighting for input commands.

Here's one for zsh https://github.com/zsh-users/zsh-syntax-highlighting
Post reply on HN