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?

  • tumulus_scrolls@lemmy.fmhy.ml
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    1 year ago

    Obvious things I don’t see mentioned:

    • Bash scripts kept in the home directory or another place that’s logical for them specifically.
    • history | grep whatever (or other useful piping), though your older commands are forgotten eventually. You can mess with the values of HISTSIZE and HISTFILESIZE environment variables in your system.
  • guacho@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Fish shell. Out of the box it autocompletes taking into account in which directory you are. It’s like bash Ctrl+r but without actually invoking it before. Really ergonomic.

  • codanaut@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    An alias file is what I’ve found to be the simplest. Just have to add one line to either .zshrc or .bashrc that links to the file. I store the alias file and some custom scripts that a few aliases call in a git repo so it’s literally just a matter of git pull, add one line to the rc file and then close and reopen the terminal and everything is ready to go.

  • jsveiga@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I use vi as the command line editor, so fetching history commands is quick:

    ESC /searchstring

    But if it’s something really frequent or may benefit from parameters, I usually throw a perl or bash script in /usr/local/bin.

  • beeng@lemmy.fmhy.ml
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    .zsh aliases to bash functions.

    Thanks for the list though, gonna take a look at a few!

  • Phoenix3875@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Try fzf. The default hooks will launch fuzzy finders for

    • C-r: history search
    • Alt-c: change directory
    • C-t: fill in argument for a nested path

    All seem pretty good for your use case.