Ask HN: Tools you have built for yourself?
My backup script, called with .&#x2F;backup, and will incrementally backup my servers on the local machine using rsync and brtfs snapshots.<p>The command &quot;list&quot; to find stuff in the current directory, recursively. Basically &quot;find | grep&quot;. Works if you have the Python module or Java package name &#x2F; path, since &quot;.&quot; will match any character, including slashes :-)<p><pre><code>    #!&#x2F;usr&#x2F;bin&#x2F;env sh

    if [ &quot;$1&quot; = &quot;-h&quot; ]; then
        exec cat &lt;&lt; EOF
    Usage: $(basename &quot;$0&quot;)^ [--] search_string

    List paths having search_string in them.
    Note: options are passed to grep.
    EOF
    fi

    if [ &quot;$1&quot; = &quot;--&quot; ]; then
        shift
    fi

    find -type f | grep &quot;$@&quot; | grep -v &#x27;.pyc&#x27; | fgrep -v &#x2F;target&#x2F;
</code></pre>
And &quot;fkt&quot;, which will open the files returned by list with your preferred editor (f for find, kt for kate, because that&#x27;s my editor and didn&#x27;t find any fitting name for this command)<p><pre><code>    #!&#x2F;usr&#x2F;bin&#x2F;env sh

    editor=kate

    if [ &quot;$FORCE_EDITOR&quot; ]; then
            editor=$FORCE_EDITOR
    fi

    help () {
        exec cat &lt;&lt; EOF
    Usage: $(basename &quot;$0&quot;)^ [--] search_string

    Open files with paths having search_string in it.
    \$FORCE_EDITOR can be used to give the name of the editor to use

    current default editor: $editor (edit $0 to change)
    Note: options are passed to grep.
    EOF
    }

    if [ &quot;$1&quot; = &quot;&quot; ] || [ &quot;$1&quot; = &quot;-h&quot; ] || [ &quot;$1&quot; = &quot;--help&quot; ]; then
        help
    fi

    if [ &quot;$1&quot; = &quot;--&quot; ]; then
        shift
    fi

    if [ &quot;$1&quot; = &quot;&quot; ]; then
        help
    fi

    list -- &quot;$@&quot; | while read line; do
            printf &quot;open with ${editor}? %s [Y&#x2F;n&#x2F;q]: &quot; &quot;$line&quot;
            read confirm &lt; &#x2F;dev&#x2F;tty
            ok=&quot;&quot;
            while [ &quot;$ok&quot; = &quot;&quot; ]; do
                    if [ &quot;$confirm&quot; = &quot;&quot; ] || [ &quot;$confirm&quot; = &quot;y&quot; ] || [ &quot;$confirm&quot; = &quot;Y&quot; ]; then
                            ok=y
                            &quot;$editor&quot; &quot;$line&quot;
                    elif [ &quot;$confirm&quot; = &quot;n&quot; ]; then
                            ok=y
                    elif [ &quot;$confirm&quot; = &quot;q&quot; ]; then
                            echo &quot;bye&quot;
                            exit
                    else
                            echo &quot;wat? &quot;
                    fi
            done
    done
</code></pre>
Turns out, I use &quot;list&quot; dozens of time per day, I forgot a bit about fkt but I might get back to it thanks to this post because I often copy-paste results from list to open them. I had forgotten about adding this confirm prompt :-)<p>I&#x27;m sure there are existing, better, tools for this though.<p>(I&#x27;ve never tested them on non GNU systems, there might be GNUisms in them)