• Jess@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    32 分钟前

    tldr because I am too impatient to read through man pages or google the exact syntax for what I want to do.

  • umbrella@lemmy.ml
    link
    fedilink
    arrow-up
    8
    ·
    4 小时前

    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.

  • RagingRobot@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    6 小时前

    CTR + u will delete the whole command. I use that a lot so I don’t have to backspace. It’s saved me a ton of time

  • papertowels@lemmy.one
    link
    fedilink
    arrow-up
    29
    ·
    8 小时前

    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
        5
        ·
        edit-2
        6 小时前

        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
    10
    ·
    7 小时前

    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.

  • huf [he/him]@hexbear.net
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    6 小时前
    • 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