Pwd stands for “print working directory.” The working directory is whatever folder you’re currently in, which typically is the receiver of an action (such as directory creation or deleting files inside of a certain directory). So, if you’re ever uncertain about which directory you’re in, just typed pwd and Terminal will spit back to you the directory location.
This command creates a new folder in the current working directory. So, if you’re in a folder called Documents and you wanted to create a subfolder called “Test”, you could type the following command to create that folder:
Deleting files and folders in Unix can be a little scary, so use caution. Unix doesn’t have a trash bin that your files go to when deleted. Once you invoke the delete command, the files or folders will be gone. Forever. We cannot stress this enough.
These two commands are used to move and copy files.The first, mv is used to move files from one location to another. Let’s say that I had a file located in my user folder, but I wanted it moved to a folder called Documents.
Have you ever wanted to find out who is logged onto your Mac? Perhaps you have a multi-user system, or have SSH enabled; either way, you might need to know who is logged in. This simple Terminal command can tell you very easily. Simply head to the command line and type in who. In a blink of an eye, the system will return a list of all the users currently logged on and what date and time they logged in. Pretty nifty, huh?
Cat is a simple way to view the contents of a file. The name is short for “concatenate and display files.” Let’s say you have a file called “test.txt” in your working directory. You think you can delete it, but you’re not sure what the contents of the file are.
Sometimes it may be necessary for you to run a command as an administrator. If you were to get an error like “Error: Insufficient privileges,” just type the sudo command before the command you were actually trying to type. This will in turn cause Terminal to ask you for your password to authenticate you as an administrator.
The sudo command is needed for things like chmod, MacPorts, and other administrative tasks.
Control + C is a way to tell a running command line-based program to quit and return you back to the command line prompt. So, if you were running a ping or other command line tool, just press Control + C to get back control.
We saved the best and easiest for last. By now, you’ve no doubt tried many of the commands, but this can leave your Terminal command rather busy with text flowing here and there. If you want to get rid of all the previous commands and outputs being displayed on the screen, simply enter clear followed by the enter key. This will wipe your Terminal screen clean, ready for you to type more commands.
Here at Mac|Life headquarters, we believe that sharing is caring. That's right: every bit of news that we could possibly want our colleagues to be privy to, we shout it out loud from the industrial-sized soapboxes stashed away under our desks. And when we can't physically make proclamations here at the office, we do so with our Macs and iOS devices on the go. In this edition of Free App Friday, we're featuring three apps that'll help you get the word out about whatever it is you've got going on, and keep you in the know about your neighbor's agenda, too.