|
The Complete Moron's Guide to some cool OSX Terminal Stuff
By Scott Woeckel
Download this as a PDF
----------------------------------------------------------------------------------------------------------First let me say this...I have never read a book, taken a 'real' class, or even had a freind with whom I could really get answers from... when it came to Mac's, or just computers in general. What I have learned and compiled here I gathered on my own, scowering the internet and asking questions on various BBS forums. I never did get much from the BBS forums...except I found I was able to answer a few questions for a few other people. With that said, be forewarned that I am NO UNIX EXPERT, and that this is just to give you a taste of the power of the command line.
Anyway, what I mean to say is none of the commands, or ideas here were found by me, and they weren't made or discovered by the folks who posted some of this stuff. UNIX is a big place and a language... and your computer is a BIG space, but to operate the system is not so difficult. In general if you approach your mac in terms of practicality, and with the intent of ingenuity you will discover many BASIC things your computer just does...and you can manipulate to do what you think it OUGHT to do!
The terminal application has brought me back to the first week I owned my G4. I wanted to throw it out the window....I couldn't get my questions answered from the 2 page manual it came with...apple help....er....no help, and found I had to find my own way which I eventually did...the full on 'blind man's' walk. Now I am here with this terminal...it's interesting, I can get the color scheme and everything set the way I want .... but then .... what can I type into it? What can I make it do?
Here are some of the better and more useful things I have found to try, and in no real particular order...also this article assumes that you know how tosudo -s to Root% , (sudo -s ...then type your administrative password) , as well as find your terminal application. So let's get silly...and remember....no particular order!
----------------------------------------------------------------------------------------------------------
Now this first one is very important. If you have tried to find a list of UNIX commands for your OSX Terminal application you know how difficult this can be, unless you bought an expensive textbook, you probably still have not found a comprehensive list just for OSX Terminal. The good news is you have had it all along...just no one bothered to tell you...yet!
To get your list, open the Terminal application and do this:
CONTROL-xthenCONTROL-d
Yup...thats it...your shortcuts for 'cut'and what ever control-d might do for you normaly, will give you a FULL list of commands for the terminal window. Now at least you have a list of the commands to learn and find more information on. If it doesn't work for you the first time, close and relaunch the terminal window. Remember you ARE NOT actually typing ANY text into the command line!
Now lets say you want to get a good look at exactly what's running on your machine. If your interested in the command line, then I will assume you have at least a half interest of what applications etc...are running on your machine! So here we go:
For a complete listing of what's running on your Mac type in the command line:
%ps aux
Wow...thats really ALOT!!!!! I bet you had no IDEA that many processes were running on your computer! I DIDN'T! =)
Want to see what happens when your system starts up? Try typing this into the terminal:
% The System Startup Log
Now here's a handy little utility that will get you that system profile MUCH quicker than using the beautiful aqua GUI to see what drives you have. Try typing this into the command line:
% AppleSystemProfiler
Thats it....now you have your system profile in the blink of an eye....rather than after six fidgets, and a trip to the bathroom.
Now here is a nice alternative to Sherlock. Here is a way to find that file Sherlock wont! Type this into the terminal:
% locate(and then the item/keyword of the file you seek and hit enter!)
It will pull up ALL matching criteria on your system.
Now lets say you know how to use the telnet features of terminal, but you want to find out your current ip address in a flash. There are two ways to accomplish this...the first is:
% AppleSystemProfiler | grep IP
This comand only works while online, or as a part of a network...the other method tells your ip status regardless of conectivity:
% ifconfig -a
Both will give you your online info.
If you want to see a report of all the open files your system is using try typing:
% fstat
If your into math, you will be interested to know that you have a calculator ( Type: % bc and hit enter. Then do your math...type6^900 you will not have a prompt (%) . Type:quit at any time to exit the program.)....as well as a calendar. Just type: %cal in the terminal for the current month... type: %cal 2002for the entire years calendar! You can also add pretty much any year you want...here's my 3004 calendar...don't be the last kid on your block to get yours!
% cal 3004
You can also make your calendar search month specific:
% cal 10 3004
Well that wasn't to painful, and I hope I led you to some useful terminal commands to check out. If you found this useful I found many of these and more at http://www.osxfaq.com
|
|