• NaevaTheRat@vegantheoryclub.org
    ·
    edit-2
    42 minutes ago

    Not a command but bang expansions. For example !? is the args of last command useful for stuff like mkdir foo ; cd !?

    https://www.redhat.com/sysadmin/bash-bang-commands learn these. you suck at using your computer if you don't know them.

  • umbrella@lemmy.ml
    ·
    2 hours ago

    control+R

    in bash, it lets you quickly search for previously executed commands.

    its very useful and makes things much quicker, i recommend you give it a try.

  • huf [he/him]
    ·
    edit-2
    4 hours 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
    ·
    6 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
        ·
        edit-2
        4 hours 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
    ·
    5 hours 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.

  • notfromhere@lemmy.ml
    ·
    9 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.

    • krash@lemmy.ml
      ·
      1 hour ago

      How does screen / tmux work when detached from a session, how does it keep the session alive (both when running locally, and while ssh:ing to a server)? Is there a daemon involved?

    • sgtlion [any]
      ·
      8 hours ago

      I would know this as tmux, is there a difference?

      • huf [he/him]
        ·
        4 hours 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

      • 7dev7random7@suppo.fi
        ·
        1 hour ago

        Simply change your terminal command to execute the terminal multiplexer of your choice.

        man terminal_of_choice, look for (start) command.

    • tetris11@lemmy.ml
      ·
      8 hours ago

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