前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Macbook 修改最近路径列表 Recent Places 数量

Macbook 修改最近路径列表 Recent Places 数量

作者头像
阳光岛主
发布2019-10-30 11:51:24
9630
发布2019-10-30 11:51:24
举报
文章被收录于专栏:米扑专栏米扑专栏

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

本文链接:https://blog.csdn.net/sunboy_2050/article/details/102785501

Macbook Pro 打开文件时,会保存最近使用的路径列表 —— Recent Places

有时候需要整理 Recent Places,清空或者设置最大保存长度,非常方便的保存最近的常用目录,不必逐级选目录

设置最近路径列表 Recent Places 数量(NSNavRecentPlacesLimit),没必要进入 root 权限(sudo -s),当前用户即可

原文请参见米扑博客:Macbook Pro 如何清空/修改最近路径列表 Recent Places 数量

一、清空 Recent Places

清空命令:

defaults delete -g NSNavRecentPlaces (慎用,最好不用)

清空后,最近路径列表,将全部被清除了,包含最近默认5条路径,也被清除了,即彻底空白

二、修改 Recent Places 的最大保存数量

设置最近路径列表 Recent Places 数量(NSNavRecentPlacesLimit),没必要进入 root 权限(sudo -s),当前用户即可

1、查看保存数量

defaults read -g NSNavRecentPlacesLimit

查看示例:

代码语言:javascript
复制
$ defaults read -g NSNavRecentPlacesLimit 
30

2、设置保存数量(核心)

defaults write -g NSNavRecentPlacesLimit -int NUM

说明:NUM 就是要设置的最大保存数量,

例如:defaults write -g NSNavRecentPlacesLimit -int 30 (保存最近30个路径列表,默认为5个)

例如,保存最近路径为30条:

代码语言:javascript
复制
$ defaults write -g NSNavRecentPlacesLimit -int 30
$ defaults read -g NSNavRecentPlacesLimit         
30

3、取消最大保存数量设置

defaults delete -g NSNavRecentPlacesLimit

使用示例:

代码语言:javascript
复制
$ defaults write -g NSNavRecentPlacesLimit -int 30      ### 设置
$ defaults read -g NSNavRecentPlacesLimit               ### 查看
30
$ 
$ defaults delete -g NSNavRecentPlacesLimit             ### 删除
$ defaults read -g NSNavRecentPlacesLimit               ### 已删除,再查看,报错(已不存在)
2019-01-28 17:24:09.033 defaults[18540:20626393] 
The domain/default pair of (kCFPreferencesAnyApplication, NSNavRecentPlacesLimit) does not exist
$ 
$ defaults delete -g NSNavRecentPlacesLimit             ### 已删除,再删除,报错(已不存在)
2019-10-28 17:24:10.993 defaults[18542:20626404] 
Domain (kCFPreferencesAnyApplication) not found.
Defaults have not been changed.
$ 
$ defaults write -g NSNavRecentPlacesLimit -int 30      ### 最后设置
$ defaults read -g NSNavRecentPlacesLimit               ### 查看 
30

How to Clear and Manage “Recent Places” In OS X

Whenever you save files to a specific location on your Mac, OS X will save this location in a “Recent Places” listing which will be available the next time you save another file. This feature allows quick access to the folders you commonly use and hence saves a lot of your precious work time.

By default, the recent places list will show you the past five most recently accessed folders. Now, while this may be convenient for some, it can become annoying, especially if you would just like to clear an item or the entire list. Unfortunately, the only way to do so via the OS X interface is to save items in at least five new locations, thus forcing the one you want to remove from the list.

This isn’t quite the best approach out there, and if you prefer to use another method, then you can use Terminal to remove the saved recent place entries from your OS X account. To do this:

1. Open Terminal on your OS X System.

2. Enter the following command to remove all the saved recent places:

defaults delete -g NSNavRecentPlaces

With this command, the Recent Places drop-down menu in the saved windows will be emptied and will then begin to populate with new folders as you save files to them.

Another tip for you is that you can also adjust the number of recent items that the system stores.

By default the number of items is five, but you can adjust this to a value of your liking with the following command:

代码语言:javascript
复制
defaults write -g NSNavRecentPlacesLimit -int NUM

Example:

defaults write -g NSNavRecentPlacesLimit -int 30

Here, simply replace NUM will the number of entries you want. Entering Zero will disable the recent places list.

Additionally, you can run the following command to remove the limit:

defaults delete -g NSNavRecentPlacesLimit

Did this work for you?

Be sure to tell us in the comments below!

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-10-28 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档