If you often get lost among the many open windows on your Mac, you can use Mission Control and App Expose to find your way. Swiping up with three or four fingers (depending how you have it set up in System Preferences) brings up Mission Control, which shows you all of your open windows. Swiping down with three or four fingers brings up App Expose, which shows you all of the open windows of the app currently in use.
With a Terminal command, you can bring App Expose-like functionality to your Dock. It lets you scroll up with two fingers on an app or folder in your Dock to see which windows you have open in that app and then jump to one of the open windows. It doesn’t do anything more than what you get with App Expose, but it adds a bit of flexibility by letting you quickly browse your Dock items without first needing to bring each app to the foreground to view its open windows.
According to iMore, this Terminal command works with the trackpad on Mac laptops and with the Magic Mouse and Magic Trackpad on Mac desktops. I found success with it on a MacBook Pro running OS X Yosemite.
Without further ado, here’s how to enable this Dock gesture.
1. Open Terminal.
2. Enter this command: defaults write com.apple.dock scroll-to-open -bool TRUE; killall Dock
3. Hit Enter.
To undo this gesture, use this command: defaults write com.apple.dock scroll-to-open -bool FALSE; killall Dock