Showing posts with label mac os. Show all posts
Showing posts with label mac os. Show all posts

Thursday, 1 March 2012

10 commands of mac os x



 
The Mac OS X command line interface is home to thousands of programs that the average user doesn’t know exists. Leveraging years of hard work by the GNU foundation and others in the open source community, Apple designed a wonderful OS that doesn’t “need” any use of the command line. While using the command line in Mac OS X is not necessary for the every day operation of a Macintosh, if harnessed correctly, it can save you a lot of time, and occasionally give you a laugh. I hope you enjoy these ten OS X command line utilities!

1. ssh
This little gem is included in every version of Mac OS X. Originally developed as drop-in replace to the rsh/rlogin programs, ssh has become a staple of the Linux/Unix(and now Mac OS X) community. Openssh’s primary use is secure remote administration. If you wish you enable Mac OS X’s built in SSH server you can do so by opening your System Preferences , clicking on “Sharing” and checking the box next to “Remote Login”. Now if you are on the road and wish to access your machine you can use a client like PuTTY (from a windows machine) or “ssh” from a Mac OS X terminal window and connect to the IP address of your Mac. After logging in with your Username and Password you will be presented with complete access to the Mac OS X command line. Openssh has many, many more uses some of which are quite advanced. My personal favorite is using ssh as a SOCKS server to browse the web securely in public internet locations.
Check out this page for more ways to use ssh on a Mac!
2. top
Top is another classic utility that has long been in use by the Linux/Unix community. To use top, open a Terminal.app and type “top”. In less time it takes to blink you eye you should be presented with a window full of text. What you see is a list of every process currently running on your Macintosh. When my Mac is running slow, top is the first resource I use to figure out whats going on.
For a complete overview of top click here.
3. lsbom
lsbom is great for that paranoid voice in your head that you often times hear before you go and install some cool new utility you’ve found on a random Mac blog (like osxdaily). With lsbom you can examine the contents of a Mac OS X installer (.pkg) and get a very detailed view of what is about to be placed into your Mac’s precious filesystem. To use lsbom, open up the Terminal.app and navigate to the place in your filesystem where the .pkg file resides. If your installer came on a .dmg, it might help to copy the .pkg to your desktop, and then cd ~Desktop. Once you have found where your .pkg resides, type “lsbom .pkg/Contents/Archive.bom> | more” and voila! You will see a complete list of files your new program wishes to install.
4. say
Now this command is unique to Mac OS X, and offers more fun than anything else. Try it out by opening Terminal.app and typing “say hello”.
5. softwareupdate
The “softwareupdate” command is a quick and easy way to install software updates from apple. To use it, open up Terminal.app and type “softwareupdate -i -a” to install all available updates for your Macintosh. If you wish to only install “recommended” updates type “softwareupdate -i -r”.
6. ifconfig
The quickest, easiest way to figure out what ip address your Mac is using, is definitely “ifconfig”. To use ifconfig, open up Terminal.app, and type “ifconfig”. You will see a lot of information, including your network card’s MAC Address. I like to type “ifconfig | grep inet” to return just the ip information for my computer. You can disable a network interface (in this example “en0″) by typing “ifconfig en0 down”. You could bring back up with “ifconfig en0 up”. This can be much quicker than using the System Preferences window.
7. lipo
lipo (aptly named) is a utility that manipulates universal binaries in Mac OS X. A lot of (almost all) programs these days ship, or download as “Universal”, meaning they have binary code that both the powerpc and the intel chips can understand. But since you probably don’t care about one of the two, you want to use lipo to “thin” down your binaries. For example if you wanted to thin the “Stickies” application to only contain intel (i386) code:
cd /Applications
lipo Stickies.app/Contents/MacOS/Stickies -thin i386 -output Stickies.app/Contents/MacOS/Stickies.i386
cd Stickies.app/Contents/MacOS/
rm Stickies
mv Stickies.i386 Stickies

8. screencapture
screencapture offers a more advanced way (over command-shift-3) to take screen captures (if you’re from the PC world, think print screen for Mac). To use it, open up your Terminal.app and try typing screencapture -iW ~/Desktop/screen.jpg. It will bring up a camera icon that is waiting to be clicked on a window. Once clicked, a file on your desktop called “screen.jpg” will be created that will contain a snapshot of whatever window you clicked on. You can of course, also take a snapshot of your entire screen by typing screencapture -S ~/Desktop/screen.jpg. If you really feel like being particular you can snag just a portion of your screen by typing screencapture -ic. Now go get some screenshots and send them over to osxdaily, we love ‘em!
9 & 10. fink and darwinports
If you’ve had your fill with the base set of OS X command line utilities, its time to open your Terminal.app’s eyes to the rest of the oppen source world. Using darwinports or fink you can download and install hundreds of free open source applications to your computer. I have found that darwinports tends to have some of the more obscure open source projects, but fink seems to be rock solid. You can install them at the same time if you REALLY know what you are doing, but generally I would have to advise that you pick one or the other. Novice users may want to try out fink, as it ships with a program called Fink Commander which gives you point and click access to its repository of software. Check it out!

short cut keys for mac os

Standard Shortcuts


Command Shortcut
Go To home Alt Home
Start of page Cmd Home
End of page Cmd End
Start of line Home
End of line End
Scroll down Cmd Down Arrow
Scroll up Cmd Up Arrow
Open document Cmd O
Reload Cmd R
Back Alt Left Arrow
Forward Alt Right Arrow
Save Cmd S
Save as Cmd Shift S
Synchronize Cmd Y
Setup and print Cmd P
Print Cmd Shift P
Close tab Cmd W
Close window Cmd Shift W
Undo Cmd Z
Redo Cmd Shift Z
Cut Cmd X
Copy Cmd C
Paste Cmd V
Delete Delete
Find Cmd F
Nest list items Tab
Move up list items Shift Tab
Parent element F2  (or Fn F2)
First child Shift F2  (or Shift Fn F2)
Next element F4  (or Fn F4)
Previous element Shift F4   (or Shift Fn F4)
Show tools F8
Zoom in Cmd +
Zoom out Cmd -
Show map areas Shift Cmd M
Show targets Shift Cmd G
Show structure Shift Cmd R
Show source Shift Cmd U
Show links Shift Cmd L
Show alternate Shift Cmd A
Show table of contents Shift Cmd T
Split view horizontally Shift Cmd H
Split view vertically Shift Cmd V
Paragraph Cmd Shift Return
Break Cmd Return
Check spelling Cmd :

Shortcut using sequences


Command Shortcut
Map Area Ctrl h Ctrl m
Preformatted Ctrl h Ctrl p
Address Ctrl h Ctrl a
Horizontal Rule Ctrl h Ctrl h
Image Ctrl h Ctrl i
Division Ctrl h Ctrl v
Blockquote Ctrl h Ctrl q
Ruby Ctrl h Ctrl r
Comment Ctrl h Ctrl c
Heading 1 Ctrl h Ctrl 1
Heading 2 Ctrl h Ctrl 2
Heading 3 Ctrl h Ctrl 3
Heading 4 Ctrl h Ctrl 4
Heading 5 Ctrl h Ctrl 5
Heading 6 Ctrl h Ctrl 6
Bulleted List Ctrl h Ctrl l
Numbered List Ctrl h Ctrl n
Definition List Ctrl h Ctrl d
Insert a Form Ctrl o Ctrl f
Button Ctrl o Ctrl b
Checkbox Ctrl o Ctrl t
File Selector Ctrl o Ctrl u
Hidden Ctrl o Ctrl h
Image Ctrl o Ctrl m
Password Ctrl o Ctrl p
Radio Ctrl o Ctrl r
Reset Ctrl o Ctrl x
Submit Ctrl o Ctrl s
Text Ctrl o Ctrl i
Fieldset Ctrl o Ctrl c
Label Ctrl o Ctrl l
Menu Ctrl o Ctrl n
Submenu Ctrl o Ctrl g
Textarea Ctrl o Ctrl a
Object Ctrl h Ctrl o
Parameter Ctrl h Ctrl w
Table Ctrl t Ctrl t
Caption Ctrl t Ctrl l
Change to Data cell Ctrl t Ctrl d
Change to Heading cell Ctrl t Ctrl h
Join with the cell at the right Ctrl t Ctrl e
Join with the cell below Ctrl t Ctrl j
Shrink horizontal extend Ctrl t Ctrl s
Shrink vertical extend Ctrl t Ctrl m
Select the row Ctrl t Ctrl r
Insert a row Ctrl t Ctrl i
Append a row Ctrl t Ctrl n
Select the column Ctrl t Ctrl c
Insert a column Ctrl t Ctrl b
Append a column Ctrl t Ctrl a
Paste before Ctrl t Ctrl p
Paste after Ctrl t Ctrl v
Emphasis Ctrl i Ctrl e
Strong Ctrl i Ctrl s
Cite Ctrl i Ctrl w
Definition Ctrl i Ctrl x
Code Ctrl i Ctrl t
Variable Ctrl i Ctrl v
Sample Ctrl i Ctrl m
Keyboard Ctrl i Ctrl k
Abbreviation Ctrl i Ctrl u
Acronym Ctrl i Ctrl y
Insertion Ctrl i Ctrl i
Deletion Ctrl i Ctrl d
Quotation Ctrl i Ctrl q
BiDi override Ctrl i Ctrl z
Insert a formula Ctrl m Ctrl m
New matrix Ctrl m Ctrl h
Plain text Ctrl m Ctrl x
Identifier Ctrl m Ctrl d
Number Ctrl m Ctrl n
Operator Ctrl m Ctrl g
Space Ctrl m Ctrl Space
Character Ctrl m Ctrl e
InvisibleTimes Ctrl m Ctrl i
ApplyFunction Ctrl m Ctrl a
Root Ctrl m Ctrl r
Square root Ctrl m Ctrl q
Enclose Ctrl m Ctrl c
Fraction Ctrl m Ctrl f
Subscript and Superscript Ctrl m Ctrl b
Subscript Ctrl m Ctrl v
Superscript Ctrl m Ctrl 6
Under and Over Ctrl m Ctrl k
Under Ctrl m Ctrl u
Over Ctrl m Ctrl o
Parentheses Ctrl m Ctrl p
Multiscripts Ctrl m Ctrl s
Structure row Ctrl m Ctrl l
Piecewise Ctrl m Ctrl j
Matrix Ctrl m Ctrl t
Factorial Ctrl m Ctrl !
Universal quantifier Ctrl M Ctrl A
Complexes Ctrl M Ctrl C
Differential Ctrl M Ctrl D
Partial differential Ctrl M Ctrl d
There exists Ctrl M Ctrl E
Arrow Ctrl M Ctrl F
Arrow with base Ctrl M Ctrl f
Greater than or equal Ctrl M Ctrl G
Integral Ctrl M Ctrl I
Special integral Ctrl M Ctrl i
Imply Ctrl M Ctrl J
Equivalent to Ctrl M Ctrl j
Less or equal Ctrl M Ctrl L
Application Ctrl M Ctrl M
Naturals Ctrl M Ctrl N
Negation Ctrl M Ctrl n
Product from ... to ... Ctrl M Ctrl P
Product Ctrl M Ctrl p
Rationnals Ctrl M Ctrl Q
Reals Ctrl M Ctrl R
Sum from ... to ... Ctrl M Ctrl S
Sum Ctrl M Ctrl s
Tend to ... Ctrl M Ctrl T
Tend to ... when ... tend to ... Ctrl M Ctrl t
Union Ctrl M Ctrl U
Column vector Ctrl M Ctrl V
Line vector Ctrl M Ctrl v
Is in Ctrl M Ctrl Y
Includes Ctrl M Ctrl y
Relative numbers Ctrl M Ctrl Z
alpha : α, Α Ctrl g Ctrl a / Ctrl G Ctrl A
beta : β, Β Ctrl g Ctrl b / Ctrl G Ctrl B
gamma : γ, Γ Ctrl g Ctrl c / Ctrl G Ctrl C
delta : δ, Δ Ctrl g Ctrl d / Ctrl G Ctrl D
epsilon : ε, Ε Ctrl g Ctrl e / Ctrl G Ctrl E
zeta : ζ, Ζ Ctrl g Ctrl z / Ctrl G Ctrl Z
eta : η, Η Ctrl g Ctrl h / Ctrl G Ctrl H
theta : θ, Θ Ctrl g Ctrl j / Ctrl G Ctrl J
iota : ι, Ι Ctrl g Ctrl i / Ctrl G Ctrl I
kappa : κ, Κ Ctrl g Ctrl k / Ctrl G Ctrl K
lambda : λ, Λ Ctrl g Ctrl l / Ctrl G Ctrl L
mu : μ, Μ Ctrl g Ctrl m / Ctrl G Ctrl M
nu : ν, Ν Ctrl g Ctrl n / Ctrl G Ctrl N
xi : ξ, Ξ Ctrl g Ctrl q / Ctrl G Ctrl Q
omicron : ο, Ο Ctrl g Ctrl o / Ctrl G Ctrl O
pi : π, Π Ctrl g Ctrl p / Ctrl G Ctrl P
rho : ρ, Ρ Ctrl g Ctrl r / Ctrl G Ctrl R
sigma : σ, Σ Ctrl g Ctrl s / Ctrl G Ctrl S
tau : τ, Τ Ctrl g Ctrl t / Ctrl G Ctrl T
upsilon : υ, Υ Ctrl g Ctrl u / Ctrl G Ctrl U
phi : φ, Φ Ctrl g Ctrl f / Ctrl G Ctrl F
chi : χ, Χ Ctrl g Ctrl x / Ctrl G Ctrl X
psi : ψ, Ψ Ctrl g Ctrl y / Ctrl G Ctrl Y
omega : ω, Ω Ctrl g Ctrl w / Ctrl G Ctrl W
Copy location Ctrl l Ctrl c
Link to previous target Ctrl l Ctrl p
Create or change link Ctrl l Ctrl l
Create target Ctrl l Ctrl t
Delete anchor Ctrl l Ctrl d
Create rule Ctrl i Ctrl c
Show applied style Ctrl i Ctrl g
Link Ctrl i Ctrl l
Open Ctrl i Ctrl o
Remove Ctrl i Ctrl r
Transform Ctrl t Ctrl x
Change title Ctrl h Ctrl t
Generate table of contents Ctrl h Ctrl g
Show the graphic library Ctrl l Ctrl s
Add the selected graphics in the library Ctrl l Ctrl f

Wednesday, 29 February 2012

what is mac os x?

This document attempts to give an answer to the question "What is Mac OS X?". My original motivation in writing this was that somebody had proxy-volunteered me to give a talk introducing Mac OS X to the Linux Users Group at my work place. While thinking over what to say to those folks, most (if not all) of whom are strangers to Mac OS X, I decided to write a supplementary document that they could refer to at their leisure.
Since I moved to Mac OS X, I have had a few discussions with people who are curious about Apple and Mac OS X, but have not used the platform. Often, what they think is a somewhat distorted, perhaps even incorrect version of the "truth": there are many areas in which they think the Mac is worse or better than it really is. Consider (with colloquialisms preserved):
  • Macs are good only for graphics/media work.
  • Macs suck for hackers.
  • There is very little software for the Mac.
  • Macs are overpriced/not worth the price.
  • Mac OS X is Unix.
  • Mac OS X is not Unix.
  • Mac OS X rocks. Linux is crap.
  • Mac OS X is crap. Linux rocks.
Related Posts Plugin for WordPress, Blogger...