Time Machine에서 숨겨진 파일을 복원하는 방법은 무엇입니까? 홈 디렉토리를 볼 수 있지만 디렉토리의

실수로 ~/.zshrc파일을 삭제 했으며 Time Machine 백업에서 다시 가져오고 싶습니다. Time Machine에 들어가면 홈 디렉토리를 볼 수 있지만 디렉토리의 모든 도트 파일은 Time Machine에 의해 표시된 Finder 창에 숨겨져 있습니다.

~/.zshrcTime Machine을 사용하는 것처럼 숨겨진 파일을 어떻게 복원 할 수 있습니까?



답변

보이지 않는 파일을 볼 수있게하려면…

응용 프로그램> 유틸리티에서 Applescript 편집기를 열고이를 새 스크립트에 복사 / 붙여 넣기하십시오 …

El Capitan이 뷰를 변경하는 트릭이 더 이상 작동하지 않으므로 Finder를 종료합니다.

키 명령으로이를 서비스로 만드는 방법은 /apple//a/258741/85275를 참조
하십시오.

set newHiddenVisiblesState to "YES"
try
    set oldHiddenVisiblesState to do shell script "defaults read com.apple.finder AppleShowAllFiles"
    if oldHiddenVisiblesState is in {"1", "YES"} then
        set newHiddenVisiblesState to "NO"
    end if
end try
do shell script "defaults write com.apple.finder AppleShowAllFiles " & newHiddenVisiblesState
do shell script "killall Finder"
return input

Mavericks / Yosemite는이 뷰 새로 고침 버전으로 작업해야합니다.이 버전은 더 빠르고 매끄럽지 만 El Capitan에서 작동을 멈췄습니다.

set newHiddenVisiblesState to "YES"
try
    set oldHiddenVisiblesState to do shell script "defaults read com.apple.finder AppleShowAllFiles"
    if oldHiddenVisiblesState is in {"1", "YES"} then
        set newHiddenVisiblesState to "NO"
    end if
end try
do shell script "defaults write com.apple.finder AppleShowAllFiles " & newHiddenVisiblesState


tell application "Finder"
    set theWindows to every Finder window
    repeat with i from 1 to number of items in theWindows
        set this_item to item i of theWindows
        set theView to current view of this_item
        if theView is list view then
            set current view of this_item to icon view
        else
            set current view of this_item to list view

        end if
        set current view of this_item to theView
    end repeat
end tell

그런 다음 응용 프로그램으로 저장하면 보이지 않는 파일 표시 / 숨기기를 두 번 클릭하여 전환 할 수 있습니다.

이 토글을 위해 Finder를 죽일 필요가 없습니다. 새로 고침이 충분하며 더 빠를 수 있습니다.


답변

Time Machine이 도트 파일을 백업하고 있으므로 안심하십시오! Finder에서 기본적으로 볼 수 없습니다. 숨겨진 파일을 복원 .zshrc하려면 먼저 파인더에서 파일 숨기기를 해제해야합니다. 터미널 창을 열고 다음을 입력하여이를 수행 할 수 있습니다.

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

이제 Time Machine을 입력하고 숨겨진 파일이있는 위치로 이동하십시오. 거기에서 복원 할 수 있어야합니다.

원하는 모든 파일을 복원 한 후 다음을 입력하여 Finder가 해당 파일을 숨기도록 되돌릴 수 있습니다.

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

터미널 창에서.


답변

터미널을 사용하여 숨겨진 파일에 쉽게 액세스 할 수 있습니다.

cd /Volumes/TIME_CAPSULE_DISK_NAME/Backups.backupdb/YOUR_BACKUP/Users/YOUR_NAME
ls -la


답변

AppleShowAllFiles pref는 High Sierra에서 사라진 것 같습니다.

다행히, 이제 (Sierra 및 High Sierra에서) Finder에게 다음과 같이 “숨겨진”(도트) 파일을 모두 표시하도록 지시 할 수 있습니다.

Shift ⇧ + cmd ⌘ +.

이것은 Time Machine에서도 작동합니다.


답변