I am currently looking for a way to easily store and run commands, usually syncing files between two deeply nested directories whenever I want.

So far I found these projects:

Other solutions:

  • Bash history using ^+r
  • Bash aliases
  • Bash functions

What do you guys use?

    • Fish shell is great, but the more I’ve used it, the more incompatibilities I’ve found:

      • Can’t use subshells
      • Can’t use bash syntax (it would help if bass would process all commands by default)
      • Can’t use bash completions (there’s a script to do that, but it makes start very slow)

      Other than that, it just works by default (unlike zsh) and it works even better with an easy-to-install Tide

      •  nlm   ( @nlm@beehaw.org ) 
        link
        fedilink
        English
        11 year ago

        Yeah, it has its downsides. zsh with some addons is probably better overall. Or if you’re at least aware of it’s differences from bash and can work with that.

  • I did not know any of the programs mentioned in the post, but some of them seem really nice. Can someone who thinks aliases are a better solution please explain why they think so and what is their advantage over these projects? Do they have any pitfalls that you are aware of?

    I believe that if I use a command sparsely enough, I will forget the created alias name just a few days later than the actual command.

  • I wouldn’t install a program for this if your use case is simple. You will end up relying on it when there are already some built in tools that can get you 99% of the way there.

    1. Bash scripts placed in ~/bin or ~/.local/bin
    • Can have simple or complex scripts setup to do whatever you want
    • Easily called from terminal or automated through cron or systemd
    1. Environment variables set in -/.bashrc
    • Great for storing common paths, strings, etc.
    • Can be easily incorporated into bash scripts
    1. Aliases set in ~/.bashrc
    • Ideal (IMO) for common commands with preferred options
    • for example you could setup your most used rsync command to an alias: alias rsync-cust=“rsync -avuP”

    Edit: rephrased to not discount the tools shared. I am sure if you had a specific reason to use them they could be helpful. But I think for many users the above options are more than enough and are supported pretty universally.