bash tricks
Permalink: https://wizardzines.com/comics/bash-tricks/
12 comments
@b0rk_reruns how did I not know about using space to avoid getting a command in .bash_history :blobcatgooglyholdingitsheadinitshands: @b0rk_reruns a rare shortcut I see people rarely use which I personally use a lot is Alt+. It adds the last argument from your previous command to your current command. @b0rk_reruns Thanks for your great zines. For those who don't know yet, passwords should never be written in commands anyway, since command arguments are visible to local users via the process table, using e.g. @b0rk_reruns I didn't know about the "commands that start with a space..." tip! I'm going to have to remember that! @b0rk_reruns for the loop example, I'd use ${i//.png/.jpg} to replace extension or ${i%%.*} to remove extension. @b0rk_reruns I also use `Ctrl+U` a lot to clear the current input. It works great, specially if you misstype a password field and want to start over, which happens to me quite often. |
@b0rk_reruns@social.jvns.ca the space trick doesn't work on some platforms