• palordrolap@fedia.io
    link
    fedilink
    arrow-up
    4
    ·
    8 hours ago

    I have an alias called save_aliases that does alias > ~/.bash_aliases. alias on its own just dumps all the existing aliases to the terminal in a format that can be parsed by Bash.

    I felt especially clever when I came up with that and used it to save itself.

    Bonus fact: ${BASH_ALIASES["name-here"]} is a way to get at the contents of an alias without resorting sed or cut shenanigans on the output of the alias command.