What's a handy terminal command you use often? - eviltoast
  • Dr. Moose@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    13 hours ago

    I really like how nushell can parse output into it’s native structures called tables using the detect command.

    Unlike string outputs, tables allow for easy data manipulation through pipes like select foo will select foo key and you can filter and even reshape the datasets.

    This is great if you need to work with large data pipes like kuberneters so you can do something like:

    kubectl get pods --all-namespaces | detect columns | where $it.STATUS !~ "Running|Completed" | par-each { |it| kubectl -n $it.NAMESPACE delete pod $it.NAME }
    

    This looks complex but it parses kubectl table string to table object -> filters rows only where status is not running or completed -> executes pod delete task for each row in parallel.

    Nushell take a while to learn but having real data objects in your terminal pipes is incredible! Especially with the detect command.

    There’s are few more shells that do that though nu is the most mature one I’ve seen so far.

  • SorteKanin@feddit.dk
    link
    fedilink
    arrow-up
    2
    ·
    13 hours ago

    Zoxide, dust, fd, rg, btm, tokei. So many newer Rust tools that are way better than the old stuff.

  • renzev@lemmy.world
    link
    fedilink
    arrow-up
    35
    ·
    1 day ago

    tldr is great. Basically a crowd-sourced alternative to man with much more concise entries. Example:

    $ tldr dhcpcd
    
      DHCP client.
      More information: <https://roy.marples.name/projects/dhcpcd>.
    
      Release all address leases:
    
          sudo dhcpcd --release
    
      Request the DHCP server for new leases:
    
          sudo dhcpcd --rebind
    
  • lud@lemm.ee
    link
    fedilink
    arrow-up
    19
    arrow-down
    1
    ·
    edit-2
    1 day ago

    As primarily a Windows admin (Yes, we exist on Lemmy ;) ) here are few I use often.

    • Enter-PSSesion
    • Get-ADUser (also group and computer)
    • CLS (aka the superior clear)
    • ii . (short for Invoke-Item . which runs the selected object using the default method. For paths (like .) the default is explorer, so ii . opens the current directory using explorer.)
    • ft (short for Format-Table formats piped input as a table.)
    • fl (short for format-like. Used like ft but for lists.)
    • Where-Object
    • Select-Object
  • NauticalNoodle@lemmy.ml
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    1 day ago

    For Debian based/descended distros:

    sudo apt-get update && sudo apt-get upgrade
    

    And technically I also regularly use

    redshift -O 3000
    

    all of the blue light filter programs try to align themselves with a user’s geographic location and time, but I don’t keep normal hours

      • NauticalNoodle@lemmy.ml
        link
        fedilink
        arrow-up
        6
        ·
        1 day ago

        I would but much like somebody else’s recent post I have in the past nuked my install by blindly agreeing to some recommended software removals before. These days I like to double check what packages are being updated and replaced.

  • Caveman@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    1 day ago

    g-push which is alias for

    git push origin `git branch --show`
    

    Which I’m writing on my phone without testing or looking

        • JackbyDev@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          7 hours ago

          When you’re pushing a new branch you’ve never pushed before you need the -u command. That’s what this alias is for.

          As long as the config’s push.default isn’t matching, git push without arguments will only push the current branch.