Skip to content

Instantly share code, notes, and snippets.

@galenseilis
Created December 20, 2022 18:27
Show Gist options
  • Save galenseilis/25a42b2ec33c08841eaca883ede1041b to your computer and use it in GitHub Desktop.
Save galenseilis/25a42b2ec33c08841eaca883ede1041b to your computer and use it in GitHub Desktop.
Create Python alias in BASH

On some systems I find that python is not a defined command, but python3 is. Since Python 2 is no longer supported, and will hopefully become scarcer in dependencies, we can assume that python represents the latest installed Python.

Assuming python3 is defined, we can define our alias in a permanent way by:

  1. Open config: vim ~/.bashrc
  2. Add the line alias python='python3'
  3. Save and exit (:wq)
  4. Run . ~/.bashrc from home.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment