Sometimes when you are delivering a presentation or recording a screencast, you may not want your audience to see your messy desktop. Fortunately, there is a quick and easy way that allows you to hide all of your desktop icons using command line.

有时候你需要做个演讲或者分享自己的屏幕,但你不想让观众看到你乱乱的桌面。幸运的通过一条命令你就可以隐藏桌面的图标。

First, open up the Terminal app either from Launchpad or by Spotlight. I personally recommend using Spotlight.

在程序列表或聚焦搜索里打开终端,我推荐用聚焦搜索(Command+空格)。

Once you have launched Terminal, execute the following command by hitting enter, which will deactivate Finder on your desktop.

打开终端后,执行下面这条命令,这样桌面的Finder就被禁用了。

defaults write com.apple.finder CreateDesktop false && killall Finder

Now your desktop should be cleared. Enjoy the absence of distraction, if not your unobstructed wallpaper.

这样你的桌面就干净了。

Once you have decided to bring your desktop back, you can execute this following command in terminal, which essentially writes the opposite setting compare to the last command. Note that your desktop can take some time to appear as Finder loads.

执行下面这条命令图标和文件就回来了,这可能需要一段时间加载。

defaults write com.apple.finder CreateDesktop true && killall Finder