Open Core Legacy Patcher: Upgrading to Sonoma
This post details the process of upgrading a Mac running MacOS 13 Ventura with Open Core Legacy Patcher to MacOS 14 Sonoma.
Aliases in the Terminal are shortcuts to run commands which you might find yourself using a lot, or they could be longer commands that you use infrequently but are more likely to get wrong. Aliases can even be used to override default commands!
Each alias must be one string of characters (could be one letter, or multiple hyphenated words), and should be something that you’ll remember.
For example, the ls command is often used with the l (long-list, i.e. detailed file information) and a (show hidden files) options, so creating an alias for ls -la might be worth considering if you use this a lot.
Note: The instructions below will work equally well on Linux/Unix systems that use zsh/bash shells, but for bash, the file to edit will be ~./bashrc.
From Catalina onwards, Apple has changed the default shell to zsh.
Start by editing .zshrc in your user home directory (it doesn’t matter if this file doesn’t already exist):
nano ~/.zshrc
Add a newline using the format below, replacing the alias name with your shortcut, and the command in single quotes with what you want to shorten.
alias la='ls -la'
Ctrl-X to quit (say Y when prompted to save).
Now run source ~/.zshrc to reload the zsh profile (or close and open a new Terminal window).
That’s it! Running la will now give a detailed list, including hidden files.
Before zsh was the default macOS shell, it was bash. The process for adding an alias to bash is the same, but we’re editing .bash_profile instead of .zsh:
nano ~/.bash_profile
Add the alias as above, and after saving the file run source ~/.bash_profile.
An an alternative to the ls -la example, if you always want to see all files, adding the alias ls='ls -a', would mean you then only need to run ls to see all files. As running ls -la is equivalent to running ls -l -a, we’d still be able to add further arguments to the aliased-ls – ls -l would then the same as ls -la.
Here are a few more examples of some aliases:
alias la='ls -la'
# Override the default behaviour of ls
alias ls='ls -a'
# Quickly run a script
alias myscript='~/Documents/scripts/bash/myscript/script.sh'
# Start a local web server for testing
# web PORT can then be used to specify port
alias web='python3 -m http.server'
Do you have any aliases you rely on? Let me know in the comments and I’ll add them to the examples above!
Share this article:
This post details the process of upgrading a Mac running MacOS 13 Ventura with Open Core Legacy Patcher to MacOS 14 Sonoma.
I'm going to prefix this whole post with: Computers/servers automatically logging in is bad security practice. Certain situations may require this…
Source lets you add external files/code into your scripts, but is also a convenient way of adding config files, providing you are aware of the risks.