| ▲ | nasretdinov 8 hours ago | |||||||
I'd advise against using sudo !! though since it adds the command to history and then it's very easy to accidentally trigger, running some undesired command as root without any prior confirmation. IMO pressing up, Ctrl-A and typing "sudo " isn't much longer but saves you from running unknown commands as root by accident | ||||||||
| ▲ | em-bee 4 hours ago | parent | next [-] | |||||||
i never found !! useful at all when i can just use up arrow to get the entry i want. it becomes more interesting when you can recall older commands, but then too i prefer search because i want to verify what command i am going to run. and i only use sudo to open a root shell. never to run anything directly. i don't want normal and root commands mixed in the same history. i could keep sudo commands out of the history, but then i don't have any history for stuff done as root. with tmux i can switch terminals easily, so i am also not tempted to run things as root that i shouldn't despite having a root shell open. | ||||||||
| ||||||||
| ▲ | 000ooo000 8 hours ago | parent | prev | next [-] | |||||||
I have a bash key binding, Ctrl+Y, that prepends sudo to the current command and submits it. I also don't use sudo-rs. No one has died yet. | ||||||||
| ▲ | kgwxd 8 hours ago | parent | prev | next [-] | |||||||
Decades ago, i used a small dns host. I wanted to switch a personal site and they just couldn't get the final step of the transfer to work. A ton of "try now" emails spanning several weeks. Then one day, I was trying to setup MySQL on a personal Linux machine, and it wouldn't let me use my "standard password" for the admin account. I knew I could just use a different one, but I really wanted to know what the problem was. Took a long time, and I don't remember how I figured it out, but I eventually tracked it to the password ending with '!!'. It took a while to put it together, and I never confirmed with the dns host support it's what fixed the issue but, I changed my password there, tried the transfer again, and it worked without any help from support. I suspect my plaintext password played some part in a script used in the transfer process, and was outputting the previous command in place of the !! I wish I had asked them if that was it, but if it was, they would have to admit to having my plain text password, or lie about it. | ||||||||
| ▲ | cocoto 6 hours ago | parent | prev [-] | |||||||
Prepend your command with a space and now your command is not saved in the history. | ||||||||
| ||||||||