home.social

#bashtricks — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #bashtricks, aggregated by home.social.

fetched live
  1. Ever wanted to use the entirety of stdin as an argument to your Bash command, newlines and special characters and all, and without any Bash expansion/globbing/escaping magic? No? Just me?

    Anyway, the magic incantation is `"$(</dev/stdin)"`. If you're gonna be typing at your terminal, remember Ctrl+D will end your message.

    I mostly use it for adding annotations to Taskwarrior tasks, but maybe commit messages with `git commit -m "$(</dev/stdin)"` and similar might also be useful.

    #bash #bashtricks #taskwarrior #git

  2. Ever wanted to use the entirety of stdin as an argument to your Bash command, newlines and special characters and all, and without any Bash expansion/globbing/escaping magic? No? Just me?

    Anyway, the magic incantation is `"$(</dev/stdin)"`. If you're gonna be typing at your terminal, remember Ctrl+D will end your message.

    I mostly use it for adding annotations to Taskwarrior tasks, but maybe commit messages with `git commit -m "$(</dev/stdin)"` and similar might also be useful.

    #bash #bashtricks #taskwarrior #git

  3. Ever wanted to use the entirety of stdin as an argument to your Bash command, newlines and special characters and all, and without any Bash expansion/globbing/escaping magic? No? Just me?

    Anyway, the magic incantation is `"$(</dev/stdin)"`. If you're gonna be typing at your terminal, remember Ctrl+D will end your message.

    I mostly use it for adding annotations to Taskwarrior tasks, but maybe commit messages with `git commit -m "$(</dev/stdin)"` and similar might also be useful.

    #bash #bashtricks #taskwarrior #git

  4. TIL: while working remotely e.g. over SSH, to overcome accidentially pressing ctrl+d one time too often and leave the current shell, we can

    export IGNOREEOF=3

    and now we have to press ctrl+d 3 times to actually leave the shell/session and/or close the terminal window.

    #bashtricks

  5. TIL: while working remotely e.g. over SSH, to overcome accidentially pressing ctrl+d one time too often and leave the current shell, we can

    export IGNOREEOF=3

    and now we have to press ctrl+d 3 times to actually leave the shell/session and/or close the terminal window.

    #bashtricks

  6. TIL: while working remotely e.g. over SSH, to overcome accidentially pressing ctrl+d one time too often and leave the current shell, we can

    export IGNOREEOF=3

    and now we have to press ctrl+d 3 times to actually leave the shell/session and/or close the terminal window.

    #bashtricks

  7. TIL: while working remotely e.g. over SSH, to overcome accidentially pressing ctrl+d one time too often and leave the current shell, we can

    export IGNOREEOF=3

    and now we have to press ctrl+d 3 times to actually leave the shell/session and/or close the terminal window.

    #bashtricks

  8. TIL: while working remotely e.g. over SSH, to overcome accidentially pressing ctrl+d one time too often and leave the current shell, we can

    export IGNOREEOF=3

    and now we have to press ctrl+d 3 times to actually leave the shell/session and/or close the terminal window.

    #bashtricks

  9. "🐧Finde & löse Datei-Probleme: Nutze 'grep' zum Suchen nach Dateinamen, 'find' für die Suche im Inhalt. Kombiniere beide, um effizient zu arbeiten. Beispiel: grep -rIl 'Suchbegriff' /Verzeichnis | xargs ls -lt | head -n 5. #Linux #OpenSource #BashTricks 💡"

  10. redteamers take note, if your c2 can't handle moving whole directories very well.

    usually works like a champ in places where they don't look at the network stack much or at all, or employs folks who openly say networking doesnt matter

    #BashTricks #ShellTricks #ssh #postgresql

  11. redteamers take note, if your c2 can't handle moving whole directories very well.

    usually works like a champ in places where they don't look at the network stack much or at all, or employs folks who openly say networking doesnt matter

    #BashTricks #ShellTricks #ssh #postgresql

  12. redteamers take note, if your c2 can't handle moving whole directories very well.

    usually works like a champ in places where they don't look at the network stack much or at all, or employs folks who openly say networking doesnt matter

    #BashTricks #ShellTricks #ssh #postgresql

  13. redteamers take note, if your c2 can't handle moving whole directories very well.

    usually works like a champ in places where they don't look at the network stack much or at all, or employs folks who openly say networking doesnt matter

    #BashTricks #ShellTricks #ssh #postgresql

  14. redteamers take note, if your c2 can't handle moving whole directories very well.

    usually works like a champ in places where they don't look at the network stack much or at all, or employs folks who openly say networking doesnt matter

    #BashTricks #ShellTricks #ssh #postgresql

  15. Still my favorite lesser known Bash feature is glob expansion during editing. Type

    echo *.txt

    And then press Ctrl-X followed by star, expression will be expanded and then you can remove items you'd like to exclude (either inside bash or press Ctrl-X followed by Ctrl-E to launch $EDITOR) #bashTricks

  16. Still my favorite lesser known Bash feature is glob expansion during editing. Type

    echo *.txt

    And then press Ctrl-X followed by star, expression will be expanded and then you can remove items you'd like to exclude (either inside bash or press Ctrl-X followed by Ctrl-E to launch $EDITOR) #bashTricks

  17. Still my favorite lesser known Bash feature is glob expansion during editing. Type

    echo *.txt

    And then press Ctrl-X followed by star, expression will be expanded and then you can remove items you'd like to exclude (either inside bash or press Ctrl-X followed by Ctrl-E to launch $EDITOR) #bashTricks

  18. Still my favorite lesser known Bash feature is glob expansion during editing. Type

    echo *.txt

    And then press Ctrl-X followed by star, expression will be expanded and then you can remove items you'd like to exclude (either inside bash or press Ctrl-X followed by Ctrl-E to launch $EDITOR) #bashTricks

  19. Still my favorite lesser known Bash feature is glob expansion during editing. Type

    echo *.txt

    And then press Ctrl-X followed by star, expression will be expanded and then you can remove items you'd like to exclude (either inside bash or press Ctrl-X followed by Ctrl-E to launch $EDITOR) #bashTricks