Conquer The Command Line: The open Command

Jim Homme
2 min readDec 21, 2020

How to use the Linux open command on Mac plus essential options

In this installment of “Conquer The Command Line” we talk about how to use the Linux open command on Mac.

When ever you want to open a file, a directory, or an application from the command line on a Mac, use the open command.

To use the open command, you need to have your Mac terminal open. oOnce opened, type open <item>. Item can be a file, an application, or a directory.

As an aside, I have always wondered why the directory tree has that name and why the main directory, the one that the other directories branch from is called the root. I googled and found this page about tree roots among other things. It says that trees grow root systems that keep up with the branches we see above ground. Now I’m good with this, because I thought that the developer jargon didn’t make sense.

Now back to our regularly scheduled program.

Opening The Current And Parent Directory

Linux uses two special designations for directories. . means the current directory. .. means the parent directory, the directory one level closer to the root, which is the highest directory in the tree of directories and files. Since Mac OS, operating system, is based on Linux, it honors this.

To open the current directory, type open ..

To open the parent directory, type open ...

Essential Options

If you have a Mac, you will find the options for the open command by typing the man command at the terminal prompt.

Related Commands

To print the working directory, the one you are currently pointing to, use the pwd command.

To change to directories, use the cd command.

To list the contents of a directory, use the ls command.

To make directories, use the mkdir command.

To remove directories, use the rmdir command.

To create files or change their time stamps, use the touch command.

To move or rename files and directories, use the mv command.

To copy files and directories, use the cp command.

Remember to use the man command to find all the options for any command on your system. And remember that for a less technical explanation of commands to check out tldr pages.

What Now?

Hopefully this post has helped you take one more step in conquering the command line. I welcome any feedback.

This post was originally written at https://www.jimhomme.com

--

--

Jim Homme

Musician, father of three, husband. Information Technology veteran. Bookworm. Chess player. Accessibility consultant. Plain language advocate