Beginner's guide to navigating the Terminal in OS X

cwa107


Retired Staff
Joined
Dec 20, 2006
Messages
27,042
Reaction score
812
Points
113
Location
Lake Mary, Florida
Your Mac's Specs
14" MacBook Pro M1 Pro, 16GB RAM, 1TB SSD
I found this great little tutorial on the basics of navigating the command line interface in OS X. For those of you switching - the Terminal program, located in Applications => Utilities is the equivalent of the Command Prompt in Windows XP. Since OS X is built on top of a variation of OpenBSD, known as Darwin, you'll find that the Terminal doesn't use the traditional commands that you might be accustomed to if you cut your teeth on DOS. The great thing about learning the OS X Terminal is that the lessons translate easily into the command line utilities of other UNIX-like operating systems, including Linux. Although the majority of basic tasks can be performed exclusively in the GUI of OS X, for those wishing to graduate to "power user" status or do advanced troubleshooting, a working knowledge of the Terminal is absolutely essential.

I hope you find this useful.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
If I may make a small correction. The terminal is the application to get to the UNIX environment. I believe you are suggesting a working knowledge of UNIX.
 
Joined
Oct 7, 2005
Messages
346
Reaction score
14
Points
18
Location
Seattle
Your Mac's Specs
MBP CD 1.83/2ghz/7200 100g + Mini 2ghz C2D 2gb + Mini 1.42ghz G4 + PM 7200/120 + Newton OMP
For those of you switching - the Terminal program, located in Applications => Utilities is the equivalent of the Command Prompt in Windows XP.

Those of us who live and breathe in the UNIX environment might take offence to that statement :black:

I'm just teasing really. I've often wondered how many Mac users ever really use the Terminal, compared to how many of us use MacOS in a large part because of having Unix under the hood (I spend the majority of my working day, and a good part of my non-working day inside a shell). The Unix environment is just another one of those reasons that MacOS X is the most powerful operating system in the world. AppleScript is another...

The main difference between the Terminal and XP's command prompt is that you can actually be productive with Terminal. The command prompt is, quite frankly, a bit of a joke. If you consider that not only does Terminal give you access to shell scripting (ksh and csh), the default install of MacOS also gives you perl, php, python, yacc, sed, and awk. Installing the development tools gives you even more goodies to play with (such as gcc).

XP's command prompt gives you, erm, let me see... DOS batch files.
 
Joined
Feb 2, 2004
Messages
12,455
Reaction score
604
Points
113
Location
PA
Your Mac's Specs
MacBook
Most users I know have never touched the DOS prompt/Command line in Windows.
These are the same people, who are recent switchers, that won't likely ever have the need to enter the Terminal.
If you have prior experience in a *nix environment, great have a ball.

My advice:

If you have never had any in-depth experience with a *nix OS, then the Terminal is one playground that should be left alone. Not having any knowledge prior to reading any "beginner" guide is a recipe for potential disaster.
To put it into "Windows Terms", (something I abhor doing, but will this time to help create an analogy)... it can be likened to messing with the Registry in Windows and having no idea what you are doing. You are going to screw something up majorly, before you actually reach whatever goal it was you were trying to acheive.

If that description matches you, then you would be wise to just leave it be.

:black:
 
Joined
Mar 30, 2004
Messages
4,744
Reaction score
381
Points
83
Location
USA
Your Mac's Specs
12" Apple PowerBook G4 (1.5GHz)
Those of us who live and breathe in the UNIX environment might take offence to that statement :black:
:mac:

(I wouldn't say that I "live and breathe in the Unix environment"...but I certainly start to suffocate in the lousy command prompt.)
 
OP
cwa107

cwa107


Retired Staff
Joined
Dec 20, 2006
Messages
27,042
Reaction score
812
Points
113
Location
Lake Mary, Florida
Your Mac's Specs
14" MacBook Pro M1 Pro, 16GB RAM, 1TB SSD
My comments were focused on recent switchers, not for hardened veterans of OS X and UNIX-like operating systems, that is why I posted the link in this forum. Please understand that I tried to keep my statements relevant to that audience.

And by all means, if you don't feel comfortable working in a command-line environment, please be aware that you can do damage to your system if you don't exercise caution. However, I believe the tutorial focused more on getting in and out of directories and basic file manipulation. None of which will do serious damage without root privileges.
 
Joined
Oct 19, 2006
Messages
152
Reaction score
7
Points
18
Something I find funny, is that when I'm on my Linux box, I find it hard to go more than 5 minutes without opening the shell to do something (Not counting when I'm randomly surfing the net), but on Mac, I open it about once every couple of weeks. it just never seems to be needed, and for a lot of what I would need it for, there's something better in the GUI that I can use.
 
Joined
Nov 14, 2006
Messages
80
Reaction score
2
Points
8
Location
Finland
Your Mac's Specs
iMac 20", 2GB ram, 500GB hd, 256MB Radeon x1600
Ah, thanks for the link cwa107! You must be reading my mind some how, lol.

I was fiddling with the Terminal some days ago but couldn't really make head nor tail of it, since it's pretty different from the Win prompt etc. So I thought I'd ask if there are any tutorials/guides on using the Terminal but never got around to actually ask about it. (=forgot)

Anyways.. seems like an interesting read. I really like to dig deep in to things. Maybe it'll reveal the soul of the OS X bit more to me. So far I've felt like an outsider when using the Mac, since I'm not fully aware of what's going on under the surface :black:
 
Joined
May 27, 2006
Messages
445
Reaction score
16
Points
18
Location
Concord, NC
Your Mac's Specs
Macbook Pro 17" 2.6GHz 4GB RAM
Since OS X is built on top of a variation of OpenBSD, known as Darwin, you'll find that the Terminal doesn't use the traditional commands that you might be accustomed to if you cut your teeth on DOS.


Actually a variant of FreeBSD. I'm an avid Unix/Linux user and agree that, unless someone knows what they're doing, they should stay out of "Terminal-land".
 
Joined
Dec 3, 2006
Messages
709
Reaction score
66
Points
28
Location
UK
Your Mac's Specs
iMac 2.93C2D 4GB
I'm pretty sure I should stay well away from the Terminal. I have no idea what it does and even less of an idea what I would need it for. I'm well aware that I sound like such a pansy right now and I'm fine with that. What do you guys actually do with it?

(Good link BTW)
 
Joined
Dec 8, 2006
Messages
59
Reaction score
2
Points
8
Your Mac's Specs
MacBook Pro, OSX 10.4.8, 2.33 GHz Intel Core 2 Duo 2 GB 667 MHz DDR2 SDRAM
I actually dig the Terminal, use it everyday. The windows prompt is crap, it's always been crap, even in Vista it's still crap. I would use Cygwin while on my windows machine but even that was not good enough. The whole Unix thing is one of the main reasons I use a Mac as my workstataion.

As far as novice users using the Terminal, I say go crazy. It's your computer so do with it as you wish.
 
Joined
Sep 4, 2007
Messages
21
Reaction score
0
Points
1
Hello Guys,

is there anyway how to go inside the Terminal when restarting the PowerMac G4 like pressing the option key or C key when the computer is restarting or starting?

will really appreciate a detailed answer.

Thanks
 
OP
cwa107

cwa107


Retired Staff
Joined
Dec 20, 2006
Messages
27,042
Reaction score
812
Points
113
Location
Lake Mary, Florida
Your Mac's Specs
14" MacBook Pro M1 Pro, 16GB RAM, 1TB SSD
Turn your Mac on, immediately press and hold Command+S. This will start you in Single User mode, essentially in the terminal.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Since OS X is built on top of a variation of OpenBSD, known as Darwin, you'll find that the Terminal doesn't use the traditional commands that you might be accustomed to if you cut your teeth on DOS.


Actually a variant of FreeBSD. I'm an avid Unix/Linux user and agree that, unless someone knows what they're doing, they should stay out of "Terminal-land".
Come on, as long as you're not doing any sudoing, there's relatively little risk in OS X. Just make sure you understand the commands you're issuing. There is very little reason not to play with perl, python, bash scripting, etc etc etc.
 
Joined
Jan 12, 2009
Messages
1,096
Reaction score
19
Points
38
Location
Prague, Czech Republic
Your Mac's Specs
2,4Ghz 15" unibody
hehe, when people will be reading this, they might actually get even more scared of the Terminal (or shell for that matter) than ever before :D

I don't think it's all that dangerous, after all how else do you want to learn than by doing something stupid :D

learning to work with the shell is and for a long time probably will be very useful so even the basic knowledge is good

on the other hand, most users don't even know something like this exists, let alone think about using it ... they might even be better off :D
 
OP
cwa107

cwa107


Retired Staff
Joined
Dec 20, 2006
Messages
27,042
Reaction score
812
Points
113
Location
Lake Mary, Florida
Your Mac's Specs
14" MacBook Pro M1 Pro, 16GB RAM, 1TB SSD
on the other hand, most users don't even know something like this exists, let alone think about using it ... they might even be better off :D

I originally posted this 2 years ago for precisely this reason - ignorance may be bliss, but I think a lot of people will be served well by having a working knowledge of basic UNIX commands. I know there are a lot of people on this forum who are new to the Mac, but would like to understand the nuts and bolts of the OS, and there's no better way than to find a good tutorial like this one and get your hands dirty.
 
Joined
Sep 4, 2007
Messages
21
Reaction score
0
Points
1
Turn your Mac on, immediately press and hold Command+S. This will start you in Single User mode, essentially in the terminal.

I followed the method you told me but it's not going in the terminal mode. my macbook pro does but powermac g4 doesn't.

any other idea?

i can't go through application>utility etc cuz i forgot the password (long story)
 
Joined
Dec 23, 2007
Messages
847
Reaction score
20
Points
18
Location
Claremont, Ca
Your Mac's Specs
iPod Nano 4gb, 20" 2.66 GHz Core 2 Duo, 2GB of ram, ATI HD 2600 pro
I would have to agree unless you know what you are doing, and why you are using the terminal for doing it, STAY OUT of there. As of right now I'm setting up a ubuntu server using pure terminal commands and I must say that it is over whelming.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I would have to agree unless you know what you are doing, and why you are using the terminal for doing it, STAY OUT of there. As of right now I'm setting up a ubuntu server using pure terminal commands and I must say that it is over whelming.
Overwhelming or enjoyable (in a nerdy kind of way)? ;)

The best way to learn how to use Bash and enjoy exploring all parts with root access is use a LiveCD or VM.
 
Joined
Dec 23, 2007
Messages
847
Reaction score
20
Points
18
Location
Claremont, Ca
Your Mac's Specs
iPod Nano 4gb, 20" 2.66 GHz Core 2 Duo, 2GB of ram, ATI HD 2600 pro
I little bit of both, I have been learning a lot more than I would by going the gui way.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top