MacOS – Show more than three recent applications in Dock

dockmacos

By default MacOS has Show recent applications in Dock enabled. But the Dock only shows the three most recent applications. How can I make the Dock show more than three?

Dock showing the three most recently executed applications

Note: I know that if you have more than three applications open it shows all of them. I am interested in showing more than three even if they are not currently running.

Also note: I am not talking about the setting System Preferences > General > drop down box for Recent items, which is 10 by default and has little to do with the Dock (so this question is not a duplicate of How to increase the number of applications shown in the Recent Applications stack on the Dock)

Bonus: ideally I would like to configure this from the command line rather than the GUI.

Best Answer