To set an alias for a longer command:

  1. Go to .zshrc file.
  2. Go to alias section and add alias for example alias pyserver=’python3 -m http.server’
  3. Now first run the command source .zshrc then only it’ll work.
  4. You are good to go!