mwpmaybe 2 days ago

This is all great, but as someone who logs into dozens of new-to-me systems every week I am unfortunately better served by learning raw systemctl and journalctl commands and training around them instead of a suite of tools and scripts that I'll need to install and configure anew each time. The fzf that ships with Ubuntu 22.04 and 24.04 doesn't even support all the options used here.

And this is why I daily-drive bash, vi, top, and screen, even on my own systems... although I can usually get away with `apt install htop fzf tmux vim-tiny` (or the equivalent) if necessary. And I don't use many shell or git aliases. Woe is me!

  • 63stack a day ago

    There are always some people in the comments that come out of the woodworks to provide a "this is great but tangential reasons why this does not fit one of my use cases" anecdote.

    You can use these tricks the blog post is showing on computers you have full control over, to ease your life a bit, while, at the same time, unbelievably, you can keep using the regular commands on systems where this is not available.

    Using these scripts does not mean you no longer need to understand "raw" commands, it's a requirement because it builds on top of those.

    • mwpmaybe 9 hours ago

      > a "this is great but tangential reasons why this does not fit one of my use cases" anecdote

      I understand your point, but I suspect I'm not the only sysadmin-type on HN and that this might be a more common (to this particular audience) use-case than your thesis would suggest.

      > Using these scripts does not mean you no longer need to understand "raw" commands

      Sure, but the reality for many is that if you spend your working hours typing "sstart" and "sj" and "gc" and "ll" and whatever else in zsh with a billion plugins, one day you'll find yourself on a P1 call at 2 AM going:

      >> oops, that's not it

      >> erg, I guess I made an alias for that on my machine

      >> what are the flags for ps again?

      >> why did that glob delete the wrong files?

      >> why isn't journalctl showing me all the logs??

      etc.

      Whereas if you have to type e.g. `ps auxfwww` and `journalctl -xel --user` a billion times a day, that will be locked and loaded when you need it. Even if you can't necessarily remember what all the arguments do. ;)

  • pram 2 days ago

    My thoughts on it. Also typically you're only going to be restarting so many things ever so the invocation is probably sitting in reverse search (and thus fzf) anyway.

jvanderbot 3 days ago

The linked inspiration project is blowing my mind.

https://github.com/joehillen/sysz/blob/master/sysz

A TUI in pure shell script?? I read the script and don't even see how it's done.

  • lupusreal 2 days ago

    You can make TUIs in bash if you use stty to set the terminal to raw mode. I'd recommend any other language than shell scripting though..

3np 5 days ago

My personal systemctl clunk pet-peeve is "get list of all currently (active/running) (units/services)". Something like a "systemctl ps".

Consider this a feature request, I guess :)

  • sudahtigabulan 3 days ago

    Do you mean that it should be invoked exactly as "systemctl ps", for convenience?

    I think the functionality is already there:

      systemctl --type=service --state=running
  • zokier 2 days ago

    Something like systemd-cgtop, systemd-cgls, `systemctl status`, or `systemctl list-units`?

    • 63stack 15 hours ago

      I've never heard of systemd-{cgtop,cgls}, they are pretty amazing, thanks!

WhyNotHugo 3 days ago

fzf is really cool to make simple TUIs.

Out of the box it already ships zsh integration to fuzzy-search history with ctrl+r. I don't know what I'd do without this.

I also have a short script, `re` to fuzzy-search a local git repository:

    fd -IH -t d '^\.git$' --format '{//}' ~/src |
      fzf |
      sed "s|^$HOME|~|" |
      wl-copy --primary
This copies the path into clipboard. I typically paste it immediately, so that `cd $PATH_TO_REPO` ends up in history for next time.

I use zk[1] to organise my notes, and it uses fzf to provide a TUI for fuzzy-search notes too.

The way in which fzf is re-usable by different scripts and tools is really neat. I the world of GUIs, we don't really have composable re-usable components like this.

[1]: https://github.com/zk-org/zk

  • lupusreal 2 days ago

    Just this weekend I used fzf (and a bit of python glue) to create my own TUI wrapper around OpenSUSE's package manager, zypper. With fzf's multi-selection mode I can select multiple packages at once to install or remove. Using fzf's preview command feature I can use zypper info (with a little bit of my own caching wrapping it) to display package info as I go through the list. A custom header shows the shortcuts for installing, removing, etc.