Skip to content

Instantly share code, notes, and snippets.

@ashalva
Last active October 22, 2024 07:57
Show Gist options
  • Save ashalva/d89a903e0c64f68c79fa534155a25ff8 to your computer and use it in GitHub Desktop.
Save ashalva/d89a903e0c64f68c79fa534155a25ff8 to your computer and use it in GitHub Desktop.
Add custom bash commands to ZSH

Add custom commands for iTerm + ZSH.

  1. Create new file and name .my_custom_commands.sh
  2. Add some functions e.g
function ios() {
  open -a "Xcode" ~/Documents/iOS/MyiOSProject.xcodeproj
}

function restartSoundCard() {
  sudo kill -9 `ps ax|grep 'coreaudio[a-z]' | awk '{print $1}'`
}
  1. Move file to directory where zsh is located. Usually it is /Users/your-user-name
  2. Open .zshrc file.
  3. Paste: source ~/.my_custom_commands.sh
  4. Save and restart iTerm.

Open iTerm and execute: ios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment