Last Updated on 2021-09-13 by Clay
open
command
We can use open
command to open any thing you want in terminal, no matter it is a folder, file or url.
Let's take a look for some simple examples.
Open a folder
We can use the following command to open a folder.
open ~/Pictures/
Output:

Open a picture
We can use the following command to open a picture via default program (The following picture is a LSTM neural network).
open ~/Pictures/LSTM.png
Output:

Open a url
Let's take my site as an example:
open https://clay-atlas.com/us
Output:

As you can see, the open
command in Mac OS can open everything if it has a default program to open, it's very convenient.
References
- https://scriptingosx.com/2017/02/the-macos-open-command/
- https://support.apple.com/guide/terminal/execute-commands-and-run-tools-apdb66b5242-0d18-49fc-9c47-a2498b7c91d5/mac