![Zsh custom alias example Zsh custom alias example](https://code2care.org/zsh/zsh-shell-custom-alias-useful-examples/images/Zsh custom alias example.png)
There are many commands that we use in Terminal often that may have many parameters (optional parameters) or are hard to remember and may take a while to type, alias command can help you to create shortcuts or name such commands with aliases that can help you speed up.
As Zsh is the default shell for macOS Big Sur (was made default since Catalina I suppose), I was trying to set my own aliases on my new MacBook, here is some examples of them that I have been using lately which you may find useful or get ideas from to create your own.
Note: If you are looking for how to set aliases follow this article:
desktop: Most often I save files on my desktop, so whatever directory I am and I want to go to desktop this alias takes me there,
alias desktop='cd /Users/code2care/Desktop'
temp:In order to know the temperature of my place, I run a curl command that displays weather details.
alias temp='curl wttr.in/chicago'
stop/start tomcat: Wherever I am, tying start my tomcat or stop my tomcat service. As a developer you might be using some other programming languages such as PHP, NodeJs and their application servers - you can make aliases for them as well.
alias starttomcat='/Users/code2care/Desktop/starttomcat.sh'
stackoveflow: This one is my favourite, when I am stuck and need help, I type this alias command and Safari opens stackoveflow.com in a new tab.
alias stackoverflow='open https://stackoveflow.com'
sublime: Opens Sublime Text Editor.
alias sublime='open -a /Applications/Sublime\ Text.app;'
- Fix: grunt: command not found (Mac/Windows)
- AppleScript Example with TextEdit
- How to copy Password of Wifi on your Mac
- Install OpenJDK Java (8/11/17) versions using brew on Mac (Intel/M1/M2)
- How to check if a port is in use using terminal [Linux or macOS]
- Cut, Copy and Paste Keyboard Shortcuts on Mac Keyboard
- [macOS] NetBeans IDE cannot be installed. Java (JRE) found on your computer but JDK XX or newer is required.
- How to Remove Widgets from macOS Sonoma 14 Desktop
- Turn off Auto-Capitalization on macOS Ventura 13
- How to Go To /usr/local/bin on Mac Terminal?
- How to Open TextEdit on Mac
- Mac: How to Open Android Studio from Terminal
- How to change the default location of Mac Screenshot
- Display Seconds in Digital Clock on Mac Menu Bar [macOS]
- How to install homebrew (brew) on M1 Mac
- Must Know Homebrew Commands for Mac/Linux Users
- Steps to Uninstall Roblox on Mac (macOS)
- How to change the System Settings Sidebar icon size Mac Ventura 13
- How to set Out Of Office (OOO) on Outlook for Mac [Updated 2023]
- Trigger Notification Center Message using Mac Terminal Command
- [fix] macOS Ventura - Python3 xcrun: error: invalid active developer path missing xcrun at CommandLineTools
- How to Install Rust Language on Mac (macOS)
- How to minimize all Windows in Mac
- Display ls command file sizes in KB (kilobytes) MB (megabytes) or GB (gigabytes) [Linux/macOS]
- How to make TextEdit the default text Editor on Mac
- How to know current Ubuntu Linux version via terminal command - Ubuntu
- How to Add Tab in Python - Python
- How to Sort CSV File Data in Notepad++ based on a Column - NotepadPlusPlus
- Read a file and Split using StringTokenizer in Java - Java
- [Python] Fix: TypeError: NoneType object is not subscriptable - Python
- Define an Infinite Number in Python - Python
- Fix: Git Pull Error: unable to resolve reference refs/remotes/origin/master: reference broken - Git
- Notepad++ display files on tab bar as horizontal instead of vertical - NotepadPlusPlus