The most effective way to do it, is to do it

Homebrew

The best practice is to run brew info before install new software. It will generally list what’s current version for this software, and etc.

brew info mariadb
brew install mariadb

How to export system variable

You can use export to declare a variable, while one tricky point to make sure surround your variable value with backtick . As below example

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

how to show full path in Finder window

Open and run following command in terminal window

defaults write com.apple.finder _FXShowPosixPathInTitle -bool true; killall Finder

how to switch differnt input

This can be configured in system proferenece->keyboard shortcuts->input sources->select next source in input Ctrl+Alt+Space

How to force an app to quit on your Mac

Press these three keys together: Option, Command, and Esc (Escape). This is similar to pressing Control-Alt-Delete on a PC. Or choose Force Quit from the Apple () menu in the upper-left corner of your screen.

To capture screenshot of Mac

Press Shift + Command + 5, then click an option, like Selection button to capture a still selection or Whole screen button to record your whole screen.

The screenshot tools appear in a small palette, which you can drag to reposition. The palette includes options for where to save the screenshot, whether to show the pointer, and more.

Save, edit, and share your shots After you take a screenshot or video, a thumbnail appears in the corner of your screen. Drag it int

Forward delete (delete char next to cursor)

Fn+Delete

To hide and show dock

Just hit Command+Option+D at any time, and the dock will glide away (or back again).

Windows

Open a file

  • Cmd+Down arrow
  • Cmd+O

Switch between windows

While you have two or more documents open in your favorite word-processing software, simply press and hold the Command ⌘ key and then strike the ~ (Tilde) key on your keyboard.

fn + ← Jump to top of document fn + → Jump to bottom of document fn + ↓ Advance down one page fn + ↑ Advance up one page

Enter path in open/save window

Press Ctrl+Shift+G will open GoTo window

Switch running applications

Besides Command + Tab, you can swipe up on the touchpad with three fingers to view the windows of open apps, allowing you to quickly switch between programs. This view is called Mission Control, which also has its own dedicated keyboard shortcut (F3).

Capture screen shot

To capture the entire screen, press Command-Shift-3

The screen shot will be automatically saved as a PNG file on your desktop with the filename starting with “Picture” followed by a number, example Picture 1, Picture 2, and so on.

To capture a portion of the screen, press Command-Shift-4

Terminal

Page up /Down

  • Page up/down: Fn + up/down arrow, or Ctrl+f/b

    Setup command line for sublime

    ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
    

Open files from terminal

open abc.jpg

To make changed profile settings take effect right away

source .bash_profile

Applications

Safari

Sublime

Switch different sublime windows

'command + ~'

Path of customize build system

~/Library/Application Support/Sublime Text 3/Packages/User/Nodejs.sublime-build

Open folders in Sublime

sublime .

Open and edit file with sublime

open -a 'Sublime Text' .bash_profile

Show full path in Sublime text 3

With Sublime Text 3, all that’s necessary is to edit your Sublime user preferences (Preferences -> Settings - User) to include:

{
  // ... other settings
  "show_full_path": true
}

Open files (go to anything) in sublime

Command + P

Go to matching brace

Ctrl + M

Go to previous/next position

  • Ctrl + “-“
  • Ctrl + Shift + “-“

Preview markdown

Command + Shift + P -> Preview

Gestures

Three (3) fingures for windows switch

  • Up: Mission control, show all running applications
  • Left/Right: Swtich desktops

Thumb + three figures

  • Center to outside: show desktop
  • Outside to Center: show launch pad

Updated: