Ask HN: Share a shell script you like

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • spellbook

    🪄 Shell and Powershell scripts registry (by jmaczan)

  • Hi, I'd like to ask what are the shell scripts you enjoy using or find useful?

    It might be something you incorporated to your terminal-based workflow. Or maybe some specific scripts that you often reuse. Or you have used it once, but it might be useful to other people. Or maybe you just have a script that is fun to use? Please share

    My (not anymore) hidden intention is to gather your recommendations to build an open-source shell script registry Spellbook https://spellbook.maczan.pl/ Source code is here for you if you want to self host or fork it https://github.com/jmaczan/spellbook

    A script I sometimes use is a commands repeater https://github.com/jmaczan/spellbook/blob/main/registry/spells/repeat-sh/spell.sh You can specify an interval and a flag to reset/keep the terminal's content after a script invocation

    Thanks!

  • z

    z - jump around

  • - quickly jump to recent directory: https://github.com/rupa/z - however I find it kinda annoying it seems to forget/ignore(?) directories, anyone know of a better version of this?

    - quickly opening my personal wiki: https://github.com/francium/dotfiles/blob/master/bin/.local/...

    - re-run a script when a file changes: https://github.com/francium/dotfiles/blob/master/bin/.local/...

    For `while-watchdo` you, you run it like `while-watchdo "echo hi"`, then in my editor, I have a custom shortcut that does `touch .watchfile` causing the command, in this case `echo hi` to run. I prefer this to tools that retrigger commands as soon as you save _any_ file. Also works in docker containers, edit a file on host, command runs in a container.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • dotfiles

  • - quickly jump to recent directory: https://github.com/rupa/z - however I find it kinda annoying it seems to forget/ignore(?) directories, anyone know of a better version of this?

    - quickly opening my personal wiki: https://github.com/francium/dotfiles/blob/master/bin/.local/...

    - re-run a script when a file changes: https://github.com/francium/dotfiles/blob/master/bin/.local/...

    For `while-watchdo` you, you run it like `while-watchdo "echo hi"`, then in my editor, I have a custom shortcut that does `touch .watchfile` causing the command, in this case `echo hi` to run. I prefer this to tools that retrigger commands as soon as you save _any_ file. Also works in docker containers, edit a file on host, command runs in a container.

  • ShellCheck

    ShellCheck, a static analysis tool for shell scripts

  • shellcheck, whilst not a script itself, I do find it useful when writing them.

    - https://github.com/koalaman/shellcheck

  • atuin

    ✨ Magical shell history

  • diffconflicts

    A better Vimdiff Git mergetool

  • diffconflicts [dc] lets you resolve diffs as a two way diff between what's in the conflict markers instead of including the resolved parts in the diff. It opens the diff in vim but could be adapted for other editors. Verbose explanation: https://github.com/whiteinge/diffconflicts/blob/master/READM...

    The author converted it to a vim plugin with the same name, but I use a different vim plugin implementation [mergetool].

    [dc]: https://github.com/whiteinge/dotfiles/blob/master/bin/diffco...

  • dotfiles

    dotfiles for vim, git, zsh, tmux, cwm, xinit, and many others. (by whiteinge)

  • diffconflicts [dc] lets you resolve diffs as a two way diff between what's in the conflict markers instead of including the resolved parts in the diff. It opens the diff in vim but could be adapted for other editors. Verbose explanation: https://github.com/whiteinge/diffconflicts/blob/master/READM...

    The author converted it to a vim plugin with the same name, but I use a different vim plugin implementation [mergetool].

    [dc]: https://github.com/whiteinge/dotfiles/blob/master/bin/diffco...

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • vim-mergetool

    Better vim-based mergetool (by idbrii)

  • fuz

    Fuzzy search text / notes in the terminal, for any collection of text files

  • I use Fuz for interactively searching my note collection, across a couple hundred text files. It's extremely useful for rapidly finding code-snippets, meeting notes or specific project information. And fast, especially combined with a hotkey for iTerm 2 that pops up a terminal and lets you search within a few keypresses.

    https://github.com/Magnushhoie/fuz

    As a nice side-effect, I no longer worry about where I store text (e.g. with Obsidian), as I know I'll find it again if it's there. It helps using memorable keywords though.

  • swift-sh

    Easily script with third-party Swift dependencies.

  • zoxide

    A smarter cd command. Supports all major shells.

  • Zoxide is basically the 'Rust Rewrite' version of the 'Z' tool and is actively maintained, I haven't had any issues with it: https://github.com/ajeetdsouza/zoxide

  • autobots

    ⚡️ Scripts & dotfiles for automation and/or bootstrapping new system setup

  • I have quite a few, my personal collection of shell scripts: https://github.com/fastily/autobots

    I also curate a shell command cheatsheet: https://github.com/fastily/cheatsheet

  • cheatsheet

    📜 A compendium of CLI commands I can't stop looking up (by fastily)

  • I have quite a few, my personal collection of shell scripts: https://github.com/fastily/autobots

    I also curate a shell command cheatsheet: https://github.com/fastily/cheatsheet

  • tools

    all-in collection of productivity scripts, CLI tools, utility libraries, fuse filesystems, and also some stuff (by bAndie91)

  • stderred

    stderr in red (by ku1ik)

  • 2. Installing all of my custom scripts as 'programs' (complete with a bin directory, for easy inclusion in my PATH) under /opt/my for better tracking/management, as opposed to e.g. /usr/local/bin

    3. A 'checkupdates' alias which performs update-checks via multiple systems (in my case: apt, flatpak, and my totally awesome misc-updater - see here if interested: https://sr.ht/~tpapastylianou/misc-updater/)

    4. libstderred (https://github.com/ku1ik/stderred)

    5. The following exports (I'll let you decipher them)

      export LESS="-I -R -S -j.5 -#2"

  • fzf

    :cherry_blossom: A command-line fuzzy finder

  • Not necessarily a shell script, but fzf with bash keybindings improved my shell experience more than anything.

    https://github.com/junegunn/fzf#key-bindings-for-command-lin...

  • pyxargs

    Command line Python scripting with an xargs-like interface and AWK-like capabilities for data processing and task automation

  • pyxargs --py "print('{}') if os.path.ismount('{}') else ''" | pyxargs fusermount -u {}

    My primary use case was using this with ffmpeg due to the encoding problem with xargs [2].

    It can also run commands in parallel using a terminal multiplexer so outputs don't get mixed up or if they require user input.

    [1] https://github.com/elesiuta/pyxargs

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts