• huf [he/him]@hexbear.net
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    9 minutes ago
    • atools, which includes als, aunpack, apack. so you can stop caring about the kind of archive and just unpack it. it also saves you from shit archives that have multiple files/dirs in their root.
    • perl -e / perl -lne / …
    • units
    • bc - a calculator that’s actually good
    • pass - the only non-shit password store tool i’ve found so far. no gui, uses gpg and git to do the encrypting and storage/sharing
    • alias lr='ls -lrth' - so you can easily find the newest file, cos that’s frequently what you want
    • unip - my script to look up things in the unicode db
    • find -type f -exec xzgrep 're' {} + - because xzgrep cant do -r

    oh yeah, and for the shell readline, alt-b, alt-f, ctrl-w, ctrl-u, ctrl-k, ctrl-a, ctrl-e

  • papertowels@lemmy.one
    link
    fedilink
    arrow-up
    9
    ·
    2 hours ago

    sudo !! to rerun last command as sudo.

    history can be paired with !5 to run the fifth command listed in history.

      • papertowels@lemmy.one
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        22 minutes ago

        I believe it’s the fifth oldest - I think !-5 will get you the fifth impost recent, but I was shown that and haven’t put it into practice.

        The most common usecase I do is something like history | grep docker to find docker commands I’ve ran, then use ! followed by the number associated with the command I want to run in history.

  • sgtnasty@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    1 hour ago

    pv (Pipe Viewer) is a command line tool to view verbose information about data streamed/piped through it. The data can be of any source like files, block devices, network streams etc. It shows the amount of data passed through, time running, progress bar, percentage and the estimated completion time.

  • macattack@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 hours ago

    Getting cheatsheets via curl cheat.sh/INSERT_COMMAND_HERE

    No install necessary, Also, you can quickly search within the cheatsheets via ~. For example if you copy curl cheat.sh/ls~find will show all the examples of ls that use find. If you remove ~find, then it shows all examples of ls.

    I have a function in my bash alias for it (also piped into more for readability):

    function cht() { curl cheat.sh/"$1"?style=igor|more }

  • BougieBirdie@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    3 hours ago

    Not a specific command, but I learned recently you can just dump any executable script into ~/bin and run it from the terminal.

    I suffer greatly from analysis paralysis, I have a very hard time making decisions especially if there’s many options. So I wrote a script that reads a text file full of tasks and just picks one. It took me like ten minutes to write and now I spend far more time doing stuff instead of doing nothing and feeling badly that I can’t decide what to do.

    • friend_of_satan@lemmy.world
      link
      fedilink
      English
      arrow-up
      11
      ·
      3 hours ago

      This is because $HOME/bin is in your $PATH environment variable. You can add more paths that you’d like to execute scripts from, like a personal git repo that contains your scripts.

    • Sneezycat@sopuli.xyz
      link
      fedilink
      arrow-up
      2
      ·
      1 hour ago

      I just aliased “sudo pacman -Syu && yay -Syu --aur” to “update” cause I got tired of writing it every day.

  • notfromhere@lemmy.ml
    link
    fedilink
    arrow-up
    13
    arrow-down
    1
    ·
    5 hours ago

    Since nobody has said yet, I use screen pretty heavily. Want to run a long running task, starting it from your phone? Run screen to create a detachable session then the long running command. You can then safely close out of your terminal or detach with ctrl a, d and continue in your terminal doing something else. screen -r to get back to it.

      • huf [he/him]@hexbear.net
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 minutes ago

        no, tmux is a newer screen. some of us havent switched cos we’re too lazy i guess? i think the common wisdom is that it’s better. i havent tried cos i already know enough of screen and it’s fine for me

    • tetris11@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      4 hours ago

      Also, screen can connect to an UART device or serial or anything that offers up a TTY