Tag: OS X

›After twenty plus years using Microsoft and Windows dating back to DOS 6.1 and Windows 3.1, I am learning how to make the switch to OS X. One thing I had to get used to was how to bring up context menus that I would always invoke by right clicking an object in Windows. To right click in OS X on the MacBook Pro, use the Multi-Touch trackpad and tap with two fingers at once. Another was the Delete key functions the same as backspace on a PC. No Home and End keys on the Mac took some getting used to as well, command and cursor key combo’s did the trick. A majority of shortcuts can be replicated by simply replacing what was done with the Ctrl key on a PC with the command key in OS X.

Windows and OS X Keyboard Comparison

Windows/PC Keyboard – Sony VAIO FW290MacBook Pro Keyboard

Here is a table of my frequently used keyboard shortcuts for each OS.

OS X

Windows

Cut

⌘ command+X

Ctrl+X

Copy

⌘ command+C

Ctrl+C

Cycle Tabs

control+tab

Ctrl+Tab

Cycle Windows

⌘ command+tab

Alt+Tab

Cycle WindowsCurrent App

⌘ command+ ~

End of Document

⌘ command+↓

Ctrl+End

End of Line

⌘ command+→or: control+E

Endor: Fn+→

Force QuitApplications

⌘ command+option+esc

Reload Webpage

⌘ command+R

Ctrl+Ror: F5

Start of Document

⌘ command+↑

Ctrl+Home

Start of Line

⌘ command+←or: control+A

Homeor: Fn+←

Page Down

fn+↓

Page Down

Page Up

fn+↑

Page Up

Paste

⌘ command+V

Ctrl+V

Select Words

shift+option+→

Shift+Ctrl+→

Show Desktop

fn+F11

Win+D

Spotlight / Run

⌘ command+space

Win+R

Webkit Dev Tools

⌘ command+option+I

Ctrl+Shift+I

Lock Screen

After enabling the lock screen in System Preferences > Security & Privacy by checking require password after sleep or screensaver begins …

For external keyboards with an Eject key use control + shift + eject

For keyboards without an Eject key, like the MacBook Air and MacBook Pro Retina, use control + shift + power

Screen Capture, OS X

Command (⌘)-Shift-3

Take a picture of part of the screen

Command (⌘)-Shift-4, and then drag the crosshair pointer to select the area. Continue to press the mouse button, release the keys, and then press Shift, Option, or the Space bar while you drag to resize the selection area. When you are ready to take a picture, release the mouse button.

To cancel, press Escape before you release the mouse button.

Terminal

base64 files

To base64 encode a file. Typically a font or image to inline into a CSS file. Add this function into your .bash_profile.

Compress (ZIP) Files

# to create a zip archive of the entire folder named myproject into myproject.zip
# and exclude .DS_Store, node_modules and .git directory
# cd to the directory that has the myproject folder, then
zip -r myproject.zip myproject --exclude "*.DS_Store" --exclude "*.git*" --exclude "*node_modules*"

Command History

Don't search history by grepping ~/.bash_history, or repeatedly hitting the up arrow, instead use control+R - press enter to immediately run the command.

Print Working Directory

Shutdown / Restart

SSH

Ctrl + D to logout of SSH session

Symbolic Links - symlinks

Symbolic link files contain path metadata of the target file or directory. If you move the target file, the symlink will break. Note that ~/ will target the current users home directory. This example creates a symlink to the Photos directory in the Downloads directory.

# /target /symlink
ln -s ~/Dropbox/Photos ~/Downloads

Web Server

Start a simple web server at the root of any folder by navigating to the folder. This example will create a web server with a base URL http://localhost:8000

python -m SimpleHTTPServer 8000

If you want to use port 80, simply leave off the port number that follows the SimpleHTTPServer command. Ctrl+C to stop the server

Other Useful OS X Tips

Activity Monitor

Use Spotlight (command + spacebar) and start typing Activity Monitor, select it to monitor what is going on with your system.

Finding Files

While in Finder, select Edit > Find (command + F). Then click the plus button to the right of the search window to add a filter. Select "other" in the first drop-down menu and select "System files". Now select "System Files" which is now an available option in the first drop-down. Select "are included" in the second drop-down and enter your search term.