News for hackers. Stuff that matters.
Re:Advancing in the Bash Shell by kbenson on Tuesday September 13, 2016 @04:13AM (#12486376)
yes, but it's not equivalent, as Alt-. only repeats the last argument.

For example, say you want to run "chown root:root foo". Alt-. gets you "foo", not the entire command, and "sudo foo" isn't useful,and in some cases could do something else entirely. For example, with the command "service foo restart", you would end up with "sudo restart" (which while it doesn't execute right away, is exactly what I'm guarding against).

Re:Advancing in the Bash Shell by barrkel on Tuesday September 13, 2016 @04:51AM (#12486507)
M-. takes the last argument by default, but it can grab other arguments by using numeric arguments (M-1, M-2, etc.) that usually has the effect of repeating the next command.

Unlike Emacs, M-1 etc. can't be typed as C-u 1 etc.