The CLI Commands I Run After Installing Mac OS

There are a couple of commands I run after installing a fresh version of Mac OS that optimise my Mac experience.

Should you have any additions, please dm me on twitter.

Select and Copy Text from Quick Look

It happens often that – for instance while searching for something specific on your Mac – you browse files in Finder and you see the data you need while using Quick Look (spacebar). With the default settings of Mac OS, it is not possible to select and copy text from the Quick Look window. Which means yoyu have to open the required application and only then copy the text.
Highly annoying and luckily a default that can be changed. After running the commands as described below, you will be able to select and copy text straight from that preview.

Make this happen

Run the following command in your terminal of choice:

1
defaults write com.apple.finder QLEnableTextSelection -boolean YES; killall Finder

That last part killall Finder restarts your finder windows, all in 1 command (by adding it with ;), rather then having to run it separately.

Back to how it was

Should you want to restore your default setting for this, run the following:

1
defaults write com.apple.finder QLEnableTextSelection -boolean NO; killall Finder

Again, that last part killall Finder restarts your finder windows.

Immediately show Dock from Hidden Position

I use my screen to the fullest and do not want any distractions that have no use. As I use Spotlight Search and Alfred to the fullest and hardly use my mouse at all (yes, keyboard shortcut junkie), I see no need to have a dock in my view. So by default I have it hidden. And when I need it, I see no need for fancy-schmancy slow animations to make it appear.
With following command in Terminal you will have your Dock pop into view quick as possible.

Make this happen

1
defaults write com.apple.dock autohide-delay -float 0; killall Dock

Back to how it was

1
defaults delete com.apple.dock autohide-delay; killall Dock

All back to default for the Dock

If you think you messed up or just want to go back to your Dock’s original settings, run the following in Terminal (or iTerm or Hyper or VS Code’s terminal):

1
defaults delete com.apple.dock; killall Dock

For fun : Custom motd (with ASCII art) in terminal

Simple and fun, the few steps to take to create a custom motd when starting up a terminal window or tab.

Make this happen

  • start up a terminal window
  • type[1]:
1
sudo pico /etc/motd
  • enter your password
  • enter your custom text or paste your ASCII art
    • you can generate some nice ASCII art yourself here
  • hit ctrl + x (to exit)
  • hit Y (to save changes)
  • hit enter (to write changes to the file β€œmotd”)
  • close all terminal windows

Done! Open up a new terminal window and there you go!

Back to how it was

Follow the same steps, just remove all text and/or ASCII art from the motd file.


  1. for this simple change I use pico, but of course you can use vim or any other (terminal) text editor. β†©οΈŽ

πŸ‘‹πŸ» Want to stay in the loop? Subscribe and I trust you will appreciate the read.