Site TIPS PAGE🔎   UP ONE LEVEL
 OJB's Web Site. V 2.1.tip tips mac owen2 
Tip

Up to OJB's Mac Tips List

Unix Terminal Intro

Many people think its very "un-Mac" to have a Unix command line in your Mac, but I think of it as having the most powerful utility program available anywhere as a backup if the GUI (graphical user interface) utilities and tools can't do the job. You definitely don't have to use Unix to use Mac OS X (or OS X or macOS), but if you know a bit of Unix its really useful, especially if you do support, programming, etc.

I should have mentioned that Unix is the operating system that Mac OS X is built on top of. Traditionally Unix has been used for large multi-user machines, servers, super-computers and high-end workstations. An OS similar to Unix, called Linux, is also quite popular for servers and as a workstation OS, but Apple is the first company to make the power of Unix available to everyone. I used Unix for years many years ago so I have transferred those skills to my Macs.

Basic Terminal Stuff

To access the Unix command line you need to run the Terminal utility. For those of you who have never used a command line - its a way of controlling a computer by typing commands instead of pointing and clicking - quaint idea, isn't it? Anyway, let's try it.

Run the terminal program and type "ls" (without the quotes, note: that's lower case L, not I, also note that Unix is often case sensitive, so use the same upper and lower case as I do here), then press return. The "ls" command lists the items in the current working directory. If you don't know what this is try typing "pwd", then return. Getting the idea? The working directory should be "/Users/yourname" (that means a folder called yourname which is inside a folder called Users, where yourname is the name of your home directory/folder). Now we will look in another directory. Type "cd Documents", then press return. Now type "ls" and return. You will see the contents of your Documents folder.

Let's find out what programs are running on our machine. Type "ps -ax" and return. You will see about 50 complicated looking lines. Each line is a different program - many run in the background without the user even knowing. Some are Unix programs, for example "httpd". Some are Mac programs, for example "Finder.app". The "-ax" after the "ps" command is a list of options which modify the basic process status command. The "a" means show all users' processes (programs) and the "x" means show system processes that would otherwise be hidden. There are many options available for the ps command. Type "man ps" for a list. After each page press space to see the next page or type "q" to quit. The man command shows the manual for a command.



My latest blog post: Learning from Failure: I think there is a place for parties with views I find insane. (posted 2024-11-28). My latest podcast: OJB's Podcast 2024-08-22 Stirring Up Trouble.
 ©2024 by OJBRSS FeedMacs are BestMac Made
T: 11. H: 174,147,471
Features: RSS Feeds Feedback LogMod: 07 Jun 2024