# 从Time Machine中恢复隐藏文件

遇到需要从Time Machine中恢复隐藏文件的需求，例如，原先备份中的Home目录下的`.ssh`包含了需要恢复的文件，但是，Time Machine备份的文件，通过文件浏览器是看不到`.ssh`的隐含文件。而直接通过Terminal终端程序访问Time Machine目录，尝试复制文件会被拒绝，提示没有权限。即使切换到root账号也是没有权限的。

以下是能够恢复隐藏文件的方法：

* 启动terminal程序
* 执行以下命令；

```
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
```

上述命令命令告诉finder显示隐藏文件，然后重启finder来显示。

* 此时就可以进入Time Machine复制文件
* 最后执行以下命令再次隐藏`隐藏文件`：

```
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
```

## 参考

* [Mac OS X – Restoring Hidden Files and Folders with Time Machine](https://www.silverbaytech.com/2013/11/21/restoring-hidden-files-with-time-machine/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://huataihuang.gitbook.io/cloud-atlas-draft/develop/mac/restore_hidden_file_with_time_machine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
