Terminal commands to remember
Terminal, or the command line interface (CLI), is considered by many to be the Holy Grail of computer management. At one time the CLI was the only way to accomplish anything on a computer; then, the CLI gave way to the graphical user interface (GUI) as the popularity of PCs increased. The purists among us often prefer to use the CLI as a means of manipulating the computer and getting it to perform tasks instead of using a mouse to get things done.
Over the years the Mac GUI has changed the way we work, but still, many people use the command line for its ability to control and automate tasks, or even configure features on the Mac that are only accessible through the CLI.
Some things in the Terminal allow users to work faster for basic or repetitive tasks. Commands can be chained together to increase their usage, and more.
Anyone on a Mac built after Mac OS X’s initial debut in 2001 can experience the command line interface through the Terminal app on their Mac through the UNIX-based shell. This app can be found inside of the Applications | Utilities folder (open a Finder window and press Command+Shift+U). The Terminal works by entering commands on the keyboard and pressing return to execute the commands. The Terminal will then respond after the command has been executed with any relevant information available (some commands may not echo back any output).
Open up the Terminal and follow some of the basic CLI commands below to grow your knowledge of how you can use command line interfaces on a modern Mac to get work done.
1. Change Directory
Command: cd
What it does: This command will change the directory that you’re currently working with in the Terminal in order to execute other commands on a different directory, view the contents of a different directory or open a file in a different directory. This is a very common command that will be used when working with the CLI. If you ever lose your place and which directory you’re in, type pwd (print working directory) and press Return to echo the current path.
Example: cd “path/to/directory/” ()
jayp@ethio-tech$ cd /var/www/html/
