Ask DN: Favorite bash_profile aliases?

over 7 years ago from David M, UI Developer

  • Jonathan SimcoeJonathan Simcoe, over 7 years ago

    This is one of my favorites. It is a bash function that will Base64 encode any image and copy it to the clipboard:

    function base() { base64 -o ~/Desktop/base64.txt -i "$@" pbcopy < ~/Desktop/base64.txt rm -Rf ~/Desktop/base64.txt }

    To run the command do this: base ~/path/to/file.jpg. Will Base64 encode JPG, PNG, and SVG.

    1 point