you are viewing a single comment's thread
view the rest of the comments
[–] 7 points 7 months ago (7 children)

All good. I'm in a piss poor mood too and just rambling.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 5 points 7 months ago (6 children)

    Its like that thing though, where you introduce someone to a new pet peeve they've never noticed - so thanks, I guess...

  • source
  • parent
  • hideshow 6 child comments
  • [–] 7 points 7 months ago (5 children)

    ls | sort -V now that I've cursed you.

    But I'm running out of mental storage space for bash commands. I wish I could clear some space.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 1 point 7 months ago (4 children)

    Make a bash alias once, get the correct behavior forever.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 7 months ago (3 children)

    What's worse is making a bunch of bash aliases that are easier to remember and then you hit an environment you can't use your bashrc in for whatever reason. Then you have no idea how to actually do anything.

    I try to only use aliases for things that I repeat often but are only going to be used in my specific environment.

    Unless you mean

    alias ls="ls | sort -V"
    

    Which would be really awful to do for obvious reasons.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 7 months ago* (2 children)

    That example is indeed what I meant. What's awful about it?

    edit: I use a customized ls alias. Most of the time it's fine, and when I occasionally need the default output, I can type /bin/ls, no new alias to memorize. The history command suggests I do this pretty infrequently, though ymmv.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 7 months ago (1 child)

    ls doesn't have the version sort option so since you're aliasing a piped command to sort you'd be passing any additional commands to sort

    So

    ls -r

    Would actually be

    /bin/ls | /bin/sort -V -r

    You could overcome this with xargs but it's just definitely a bad idea in general to alias a standard command piped into another command. Will cause headaches.

    Where as something like

    ls="/bin/ls -r"
    

    Just defaults ls to a reverse sort and you can still safely add additional args.

  • source
  • parent
  • hideshow 1 child comment