The Mac Terminal: An Introduction
This article is a piece in a series of upcoming articles.

Mac OS X isn’t just known for it’s fancy GUI. It’s known for it’s powerful underlying core OS, UNIX, and the Terminal is the way that you can access the UNIX base. For you new switchers, the Terminal is equivalent to the Command Prompt in Windows, or the Command Line/Shell/Terminal in Linux. Many Mac users never even open Terminal, however these users are missing out on some of the most powerful features.
To open Terminal, navigate to your Applications folder, open Utilities, and double click on Terminal. You will be greeted with a message similar to this:
Last login: Tue Mar 6 17:21:36 on console
Welcome to Darwin!
ibook:~ Alex$
The last line you see is called the prompt. This will appear after every command you enter and this is where you type your commands. It consists of your computer name, your current directory, and your short username. When you first start Terminal, your current directory will be “~”, which is short for your home directory (/Users/Your username).
One of commands you will use most is ls. The ls command will show you the files and directories that are contained in your current directory. Here’s an example:
ibook:~/Desktop/mammoth Alex$ ls
final1.jpg final3.jpg final5.jpg final6.jpg final7.jpg
By typing ls and hitting enter, the terminal shows me all the files that are in my “mammoth” directory. If you want to see the contents of a directory besides the one you are in, just type ls followed by the directory.
You are probably wondering how to change your current directory. This is done with the cd (change directory) command. Just type cd followed by the directory you want to change to. Example:
ibook:~/Desktop/mammoth Alex$ cd /Users/Alex/Desktop
ibook:~/Desktop Alex$
If you want to get to a directory that is inside of your current directory, just type cd followed by the directory name, as there is no need for a full path. To save time, the terminal has an autocomplete feature (most command lines have this). To use it, press tab when typing a file or directory and Terminal will guess what you are trying to type. Don’t forget about ~. Entering cd ~ will get you back to your home directory. A final, and very useful cd tip is that cd .., will navigate you to the directory above the one that you were in.
If you are experimenting with UNIX commands and need help with a certain command, it is always available. Either type:
command --help (quick help) or man command (full manual) Typing q will get you out of a command’s man page.
Although cd and ls don’t do much, they are a good foundation for further command line adventures.





Best thing to use terminal for if you’re not at home and you need to send an email.
For those who don’t know:
mail somone@someone.com
Subject: Something
Your message
.
And you have sent an email
# command –help
will only work on the GNU tools, thus, using the man pages is much more ideal, that said, mistyping the flags of a command will tell you the usage, as long as you understand it, then its ok.
this made front page at digg.com!
For you new guys out there, don’t do what Gary said, he’s being an *sshole.
That would delete your entire harddrive. So, yeah, don’t do it.
Unsafe comments deleted. What a lame thing to do :/
Gary….way to be a dickhead.
Please ignore comment no 5 – if you are a newbie and you type that command you will basically delete everything on your hard disk.
Not bad. Make some references to other *nix articles on the net.
Other than that, tis great.
–Dalton
[...] read more | digg story [...]
[...] you’re interested in learning about the Terminal, but don’t know where to start, this article from MacApper is a great place to get your feet [...]
Just like linux … mac sucks, linux rulez
Linux Guy, grow up. Just let people use the OS that they want to use for whatever reason they want.
i think the macs are nice… i would get one if they had linux drivers/certification and nividia cards would be nice ati is bad for linux
What exactly is the point of terminal though? I mean, who would want to know what’s in your current mammoth directory?
[...] MacApper » Blog Archive » The Terminal: An Introduction Kanske om jag ska göra nÃ¥t nÃ¥n gÃ¥ng i terminalen, läs dÃ¥ här dÃ¥ (tags: mac osx terminalen) [...]
Knight — there’s a lot more to it than that. Terminal is just as much an interface to Mac OS X as the Finder is; more so, in some ways. Almost anything you want to do on your computer can be done from Terminal
[...] the last Terminal Tutorial, I went over the two commands cd and ls, which just allow you to view your files. In this segment [...]
[...] covers the basics of the Terminal, and two basic commands to get new Terminal users on their feet.read more | digg [...]
[...] The Mac Terminal: An Introduction An introduction to the powerful Terminal in OSX [...]
********* Edited for the terminal code could seriously b0rk your HD if you didn’t know what it was you were doing.
gary roberts is a pirate in the off=season and sails the seven seas pillaging villages!
man, that guy, gary roberts, he’s so awesome!
macs are not as good as gary roberts. Gary Roberts can do more floating-point operations in a second than any macintosh.
gary roberts has better ratings than you
Gary Roberts: a sitcom, a truck….. a legend.
[...] I don’t know the Mac and of course if a Mac user read this thread he can help you much more than me. Anyway, the Mac can use command line commands (Unix style) using the terminal. [...]
[...] read more | digg story [...]
[...] read more | digg story [...]
[...] also serves, simply, as an extra PC around the house. True, I can also learn Unix commands via the Terminal on my mac (on Mac OSX or using a virtual machine to run Linux), but it gives me greater peace of [...]
[...] read the Mac Terminal Introduction by Alex and learn [...]
Welcome to Darwin
sudo rm gary roberts
$
To Knight The point of using Terminal is basically threefold. First, it’s often faster to use. Second, it can be used to carry out commands with a lot more force, especially the “sudo” command. Third, it allows you to modify preference files that can’t be altered from a “Preferences” menu, and it does it in a way much easier than opening it as a text file.
i almost deleted my entire hard drive because of you a**hole!!
[...] just in case, you do not see your drive there, close the Time Machine settings window, launch Terminal and run the following [...]
You call this in introduction? cd and ls? what do you call advanced?
[...] a free download text editor. The Mac Terminal: An Introduction Top 50 Terminal Commands Common Terminal [...]
If I have several terminal windows open, I can go to the first by typing command 1, the second by typing command 2, etc. I think this is referred to as “making the first window active,” “making the second window active,” etc.
Is it possible to write a unix alias that can be typed in *any* of the Terminal windows and will make, say, the third window active?
Alternatively, is it possible to create a keystroke (say, using Quicken or Applescript) that I can perform no matter which application is currently active, that will make, say, the third window active?
Thanks for any insight
Jake
Hola yo utilizo muxo la terminal en linux me comprado un mabook y mi ermana lo ha borrado de la carpeta aplcaciones, como puedo volver a instalarlo e metido el cd de instlacion y con el pacfist e explorado y mirado todos los paketes, q mas ago?
ughh i need help. please! i have a G4 emac. i recently updated to leopard 10.5. I have everything on here EXCEPT “Terminal” ; i go into “Utilities” and its not there. Is there any way i can download it? Or am i *ssed out? =/
PLEASE HELP
[...] The Mac Terminal: An Introduction [...]
[...] Terminal. If you don’t know how, the learning starts here. You can do it, Happy [...]
I am so freaking happy that I finally figured out how to navigate my way through terminal. Thanks alot for this.
How do I restart from terminal? Lately, if I use applejack on my iMac, OS 10.5.7 it leaves me after saying restarting, which doesn’t happen, then a line saying killing all processes
[...] The Mac Terminal: An Introduction | MacApper Great post introducing people to Mac Terminal (tags: mac osx apple reference tutorial shell programming) [...]
[...] The Mac Terminal: An Introduction | MacApper Great post introducing people to Mac Terminal (tags: mac osx apple reference tutorial shell programming) [...]
Great topic, though it’s not an advance introduction it’s good enough to know there is a terminal. I’ve been working with linux most of my short life and when I actualy find out my new macbook also had a terminal I really was so happy (:
Question about autocomplete in the mac terminal,
In linux when you press the tab key completes the word if possible and if not show the possible options is this also possible in the mac terminal?
I didn’t even think about terminal usage on Mac. I love it on my linux box but Mac hmmmm. Maybe I should get a mac.
[...] Terminal – Too geeky to get into¦ [...]
[...] extracting the archive open the Terminal, which can be found in /Applications/Utilities/Terminal.app, and navigate to the directory in [...]
[...] to the Mac Terminal on Macapper.com. The link to the article is here if anyone else needs help- The Mac Terminal: An Introduction | MacApper. I will try this approach as well. [...]
I was terrified of Terminal until I read this series.
Figured if I typed something wrong my Keyboard would jump off the desk and bat me around the head or something of the sort.
the cd comand doesnt work i try it but it says that there is not command like that why?
and the is command they cant find but the cd just makes a new thing with the name and that stuff
[...] get me wrong, playing in Terminal is sublime geekiness but still something I wish was easier. Say, with a keyboard command or mouse [...]
Dude, CD and IS is a little too primary. I do like the last comment about the email command. Great stuff!
In the first sentence, “it’s” should be “its”.
Gary your a real piece of shit, nothing to do with your life. Except stealing oxygen, that someone could use. Do use a favor and blow your face off.
[...] it's tools are definitely old school CLI (command line interface). So it will pay you to learn how to open the terminal on the Mac and [...]
[...] used to clean GUI’s and throbbing buttons, delving into the ugly text-based world of the Terminal is not a desirable route. So what to use? Handily there are two exceptional software options [...]
[...] using the “ping” command, which is available in the Command Prompt in Windows or the Terminal on Mac OS X. Lower numbers are better (see screenshot below). Note that the latency increases along [...]
[...] edit it, type this into a terminal (Applications > Utilities > Terminal) sudo [...]
Grammar police patrol: The possessive pronoun “its” does not have an apostrophe.
[...] Terminal “ Too geeky to get into¦ [...]
take terminal command to do something epic, like download a youtube stream and rip the mp3 audio out of it
youtubedl is the youtube download command
pipe the command
| = data pipe
mplayer is a media player for video and audio with many flags and options to record or play back things give it the flags to record audio 0only and to drop it into a mp3 file.
youtubedl (addressofvideo) | mplayer -(whateveroptions to rip just the audio track)
take that big command, then drop it into a file with some algebreic variables for the video number. designate the file as an executable then drop it into your main directory of terminal programs
terminal is where the power of unix is. stringing and combining commands to manipulate text and data into the exact way you want it. people who do not know the terminal are missing the big big big picture of unix.
the youtubedl is probably a very simple download script that was built in the same way as the script you would be making. many things interdepend upon eachother.
when terminal asks me for ‘password’, it doesn’t show up when i type, as i have heard that you just type in as usual, i did, and yet it says ‘sorry, try again’, even though i continually enter my password. HELP PLEASE.
Thank first for your nice stuff. and the is command they cant find but the cd just makes a new thing with the name and that stuff
But my friends at school can get the voice guy to say what they type, but mine won’t do anything. What am I doing wrong?
[...] on a first come, first printed basis. But you can also manage your printer and its jobs using Terminal, Apple’s built-in command line [...]
Ok I have done a REAL dumb thing so. Don’t have to much of a go at me. I used terminal to try and delete a folder that was in the trash. I typed in the a code that was given to me. I lost my document folder all files that I had on my desktop. I even lost email addresses in my address book. SO that’s what happen..Now I gather there is no undo for this. So I guess all was deleted off my hard drive. Question is … Is there any way to recover these lost items? Should I use a recovery program and if so what is the better one to use. Im on a iMac intel 10.4.11 There may have been other stuff lost as well but not sure. Well that’s my first adventure with using terminal. Was not a happy person. Hope you smart Mac and terminal uses can help in my hour of need. Cheers John
thanks for the information
I was wondering if there are any command “make”
please help me, i try to follow this
$ PATH=/usr/bin:$PATH # for GCC made in AppleLand
$ make
$ sudo make install
$ PATH=$OLD_PATH
http://blady.pagesperso-orange.fr/telechargements/gnat/Install-GPS.pdf
[...] open a terminal window (from the /applications/utilities folder on your computer), and use the CD command to navigate to the PICkit 2 folder on your desktop. Once inside the PICkit 2 folder type the [...]
The O’Reilly Unix reference has a great, quick intro to the shell and is a go to reference book. Unix Power Tools is also good as a way to learn a trick a day that you didn’t know you could do with the shell. Somewhere along the way you will become rabid about one debate (vi vs emacs) and have strong opinions about another (perl vs. sed/awk). I don’t know how that happens, but it does. Oh, and by the way, welcome to your new job consulting, and remember that your business partners can’t help themselves, they just don’t know any better.
This is weird but how do you get it to delete your harddrive my bro gave me his laptop and forgot to take everything off plzzz help me
This was a really straight forward and helpful article. Thank you kindly for sharing it.
so i seem to have wiped my entire hard drive…..didn’t have time machine running, is there any way to get all my data back?
[...] that you familiarize yourself via some tutorials. Some well written tutorials are included here, here, and/or [...]
[...] like the flexibility of using the Mac Terminal, or another editor to work with Python. For today’s chapters I used the IDLE application in [...]
theres another cool site for codes. terminalcodes.blogspot.com
[...] navigate to your Applications folder, open Utilities, and double click on Terminal." From here. __________________ [...]
[...] The guides assume some familiarity with your operating system’s command-line (Windows, Mac) [...]
[...] guides assume some familiarity with your operating system’s command-line (Windows [12], Mac [...]
hello, everybody, I’m heng , i’m student first year in CIST. So that, now i’m studying about OS linux , but i don’t know how to use . so i need someone to help me , who can teach ? Thank you so much .
Thanks for this article. I consider myself a very experienced Mac guy but have never really gotten into the Terminal. This refreshed my memory. Thanks.
MacOS terminal is such a copycat of bash-Linux.
Oh yeah Why is MacOS called Darwin? Steve Jobs was never Darwin.
I’m studying Linux too!
Hi Guys, I just found a pretty nice site for unlock / jailbreak/ iphone 3g 3gs and iphone4 jailbreak.
http://www.anysim.net
Thank u Anysim Team for fast Support.
Did everybody now when the update ios 4.3 for iphone4 comes?
[...] “Mac OS X isn’t just known for it’s fancy GUI. It’s known for it’s powerful underlying core OS, UNIX, and the Terminal is the way that you can access the UNIX base. For you new switchers, the Terminal is equivalent to the Command Prompt in Windows, or the Command Line/Shell/Terminal in Linux. Many Mac users never even open Terminal, however these users are missing out on some of the most powerful features.” – from macapper.com’s article The Mac Terminal: An Introduction [...]
I don’t have it and I have “tiger,” is that the problem?
[...] Terminal and type “chmod 744 ~/azilink.sh” (without the quotation marks) and press [...]
sbin/mount -uw /
rm /var/db/.Gary Roberts
reboot
hi
Great way to use the mac terminal
thanks
Hi,
i am new at terminal, i open Terminal, and it comes up blank.
How do i log in? i am missing the text that says something like this.
Last login: Tue Mar 6 17:21:36 on console
Welcome to Darwin!
ibook:~ Alex$
(this is an example i found)
how do i know what to type for me to be able to log in.
sorry for my ignorance!
i will apreciate any help
Hi,
i am new at terminal, i open Terminal, and it comes up blank.
How do i log in? i am missing the text that says something like this.
Last login: Tue Mar 6 17:21:36 on console
Welcome to Darwin!
ibook:~ Alex$
(this is the example)
how do i know what to type for me to be able to log in.
sorry for my ignorance!
i will apreciate any help
Hey everyone, I need some help! Really badly.
So, I have the blue screen of death. For any one who doesn't know what that is.. here's the story
-recently (less than 90 days ago) bought the new imac
-while it was software updating (firmware flashing, i believe) i unplugged it. might have been stupid, but apple did not warn me whatsoever that it was doing a system update
-until a couple days ago, wouldn't do anything but turn on, show a blue screen with a flashing bar, then turn off
-i put in the os x install cd, while pressing c and all that fancy stuff.
-unable to reinstall os x on the drive
-went to disc utility, unable to repair
-the guy at apple said my only option was to completely reboot the system, in effect i will lose everything (NOT an option) OR go to a specialized computer fixin' place and probably pay big bucks. not really into doin that, either
i was wondering if there was a way i could use TERMINAL to solve the problem..
I have another mac (macbook) and a time capsule (that is a modem / back up)
also i didn't back up my imac files with time machine, stupidly, but i figured i didn't need to yet since it's only been 2 months.
so yeah any help would be GREATLY APPRECIATED
<3
<a href="http://www.hatsnewera.com" title="Wholesale Hats New era">Wholesale Hats New era</a>
<a href="http://www.hatsnewera.com" title="Cheap New Era Hats">Wholesale Hats New era</a>
<a href="http://www.hatsnewera.com" title="New Era 59fifty Hats">Wholesale Hats New era</a>
Normal
0
7.8 ?
0
2
false
false
false
MicrosoftInternetExplorer4
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:????;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:”";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:”Times New Roman”;
mso-fareast-font-family:”Times New Roman”;
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
On the internet there are many online stores that offer <a href="http://www.mvphats.com/">mvphats</a>, but it is the best. In serving customers, it always put the best service and they only sell the with the best quality. You will be pampered with a wide range of choices, many prestius <a href="http://www.mvphats.com/red-bull-hats-c-36.htmlhttp:/www.mvphats.com/">Red bull hats</a> offered by mvphats.com, such as red bull new era hats, new era 59fifty hats,caps new era,red bull energy hats,New Era Hats Wholesale, Monster Energy Hats, <a href="http://www.mvphats.com/dc-hats-c-13.html">dc hats</a>,and many more.
With havin so much content do you ever run into any issues of plagorism or copyright violation? My site has a lot of exclusive content I’ve either created myself or outsourced but it looks like a lot of it is popping it up all over the internet without my authorization. Do you know any ways to help protect against content from being ripped off? I’d truly appreciate it.
Many thanks for this terrific write-up, I have sent the link to my friend, sure he will turn into a reader soon too.
your article is very good, I like it very much.Here I learned knowledge, then I will pay more attention to you,Your post is an excellent example,I keep on reading this attractive blog
you can go to our blog :http://www.b2cjordans.com and http://www.smoncler.com
Like the Bailey Button, the Ugg bailey button boot met logo chestnut is a tall boot made from genuine twin-face sheepskin. We’ve updated this traditional style with three wooden UGG® logo buttons and elastic band closure. The Ugg bailey button fancy boot can either be worn up or cuffed down adding a little variety depending on your style.
The article in your blog reminds me some old memory .UGG Montclair Boots SaleThat is good .It gives me happy .I think we will have a harmonious talk.Do you agree?Montclair UGG Boots Sale
2 . 42Use2 being shy to your benefit – Individuals completely love carrying on about themselves, so provide an ear for them to let unfastened on, and also you’ll make a buddy in the process. Don’t be intimidated by louder, extroverted web workers. They want you, and they know it. Just be your self, be well mannered, listen, and sacrifice your ears over to the extroverts.
[...] Instructions on how to use the Mac Terminal can be found here. [...]
[...] Instructions on how to use the Mac Terminal can be found here. [...]
Wind, blown crystal snowflake Solitude, tods shoes uk,tods shoes uk bleak memory, because you and warm.
Your post is really excellent. I like it very much.
[...] Open up a terminal (instructions for Windows, Linux and Mac) [...]
I HATE YOU ALL!!!!!!!!! YOU ALL SUCK AND NEED TO STOP SINNING.
Thank you for this article. After reading it I opened the terminal on my computer. Very helpful!
wholesale 59fifty nhl hats,cheap new ear caps,wholesale Fox Racing Hats
[...] commands like sudo and cd make your eyes cross, here’s a primer on the Terminal. Otherwise, enjoy your nice, clean Finder! This entry was posted in Tips by Tony. Bookmark the [...]