• @[email protected]
    link
    fedilink
    English
    224 days ago

    I seem to be one of very few people that does not use shell aliases. I much prefer just using the reverse history search for previous commands instead. That way I don’t have to remember what letter I picked for different things, just ctrl+r then partially type out the command and I can see what it will execute. Bonus that I don’t need to set them up before hand and that I can edit them before executing them for those times when I need to do something slightly different.

      • @[email protected]
        link
        fedilink
        English
        23 days ago

        TBH, not quite the same. You have to know which one you want. If you don’t quite or get it wrong you need to clear the line and start again. I quite like that I can reverse search and keep typing, or undo what I had typed and still see a list of the most recent things and can select from that list once I see what I want. This works for any command I have previously typed and dont need to setup specific key sequences for it - just any part of that command will find it again. Also works for complex chains of commands or pipes which I do not think aliases do work for.

        • @[email protected]
          link
          fedilink
          33 days ago

          I quite like adding a fuzzy finder to the history search - helps when I can only remember part of the command line I was using. Have just started using atuin.sh which seems okay.

    • @[email protected]
      link
      fedilink
      English
      53 days ago

      No, I’m the same. I started down that road but found myself too dependent on a lot of custom scripts and aliases. It became a pain when I used unix and Linux systems at work, or work in containers, etc.

      • @[email protected]
        link
        fedilink
        English
        53 days ago

        I used to know a guy that would put everything into aliases or scripts in order to avoid remembering them. It worked well most of the time but when something went wrong or was not covered by his scripts he would struggle a lot. He avoided learning the underlying commands and what they did and so could not adapt to things when circumstances changed even a little - which does happen quite a lot.

        Which is probably another reason I don’t use them. I don’t like to set them up straight away while I am learning the tool and once I am comfortable with it a reverse history search is good just as good/quick as a true alias anyway and means I never forget what I am doing and can edit it on the fly easily when needed.

    • @[email protected]
      link
      fedilink
      53 days ago

      I make ~/bin scripts that can be saved, then you have a backlog of real, backed up scripts you can add to path anywhere

      • @[email protected]
        link
        fedilink
        53 days ago

        I’m an apprentice to both your ways.

        I create a tidy backed up script in ~/bin, and then I only ever evoke it from my bash history, because otherwise I don’t remember I had it.

      • esa
        link
        fedilink
        13 days ago

        Yeah, that’s what I do for complex stuff. Aliases are pretty handy too, but I use them for stuff like “v=nvim” and “vd=nvim -d”. Also one function for fd to “nvim $(rf -l $1)”

      • @[email protected]
        link
        fedilink
        English
        13 days ago

        I do use scripts for more complex things. But even then I have a few very frequent one liners in my history that are 3-4 commands chained together that I have not bothered to convert. It tends to only be when they start to have logic in them that I will write a script for. Or more one off commands that are easier to edit in a multi line editor then trying to get everything right in the shells prompt.

    • @[email protected]
      link
      fedilink
      3
      edit-2
      3 days ago

      I do use aliases, though differently too. For example, i use multiple distros. Instead of “uh, what was the xbps command to find what package contains this file?” i just have it automatically set to a bunch of aliases in a case switch based on package manager. Another one; some tools that follow XDG only optionally via parameter.

    • dinckel
      link
      14 days ago

      Any time a shell alias would be useful, i have to setup an equivalent of a makefile anyway. My current setup has no aliases active, for the same reasons as you

      • @[email protected]
        link
        fedilink
        12 days ago

        I have so many Makefiles. But I refuse to acknowledge that I might have a problem.

        I’ve been clean from using autoreconf for almost a decade, at least.