Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We use Apple's Time Machine to back up our Apple 10.5.8 workstations at the office.

If I want to restore a file, I need to open up the Time Machine GUI and browse files there. The GUI is ugly eye-candy and gets in my way.

Is there a way to browse the Time Machine archive using the Mac's command-line?

I'm used to Netapps and other storage appliances. I use backintime for my Ubuntu workstation. To restore a file with one of those systems, you can restore a file with a simple command like:

cp .snapshot/daily.0/filename.txt .


cp /backup/backintime/20100611-000002/backup/etc/shadow /etc/shadow

Is there an equivalent for Apple's Time Machine?

share|improve this question
An intermediate solution would be to use Finder to browse the Time Machine backups just like a regular folder. – fideli Jun 14 '10 at 22:23
@fideli : You said we can browse Time Machine in the finder. I didn't realize this was possible. It also turns out we can browse the Time Machine folder using the commandline! For example, I can a backup of ~/.vimrc at /Volumes/TimeMachine/Backups.backupdb/$HOSTNAME/Latest/$USERNAME/Users/mydirect‌​ory/.vimrc. – Stefan Lasiewski Jun 14 '10 at 22:48
@fideli : I think you answered my question. Go ahead an put in your answer below, mention something about 'command-line' and collect your prize! – Stefan Lasiewski Jun 14 '10 at 22:48
up vote 5 down vote accepted

Putting my comment as an answer. An intermediate solution would be to use Finder to browse the Time Machine backups just like a regular folder. If you want to browse it in the command line, drag the folder from the Finder to the Terminal window so that you don't need to hunt through the many levels of directories that Time Machine sets up. Enjoy!

share|improve this answer
how do you drag a folder from Finder to Terminal while browsing a Time Machine backup? – Erik Allik Dec 6 '13 at 3:07

Restoring a backup from command-line can be done with the tmutil command:

tmutil restore <complete path to snapshot> <path to restore>

For example:

sudo tmutil restore /Volumes/TimeMachine/Backups.backupdb/Server/2013-03-18-002707/Boot\ HD/Users/me/Documents/loveletter.doc loveletter.doc

Will restore your love letter from the backup on March 18th.

share|improve this answer
Actually, tmutil is not even needed to operate on the stuff in /Volumes/TimeMachine/Backups.backupdb. – Erik Allik Dec 6 '13 at 3:26
Maybe you can use raw files copy from Backups.backupdb, but as being prudent I prefer using appropriate tools, you never know... – CharlesB Dec 6 '13 at 9:53
I think a straight cp would not strip the timemachine metadata from the restored files. So , yes, better to use tmutil. Don't know whether copying using the Finder would strip them. – Matthew Hannigan Jul 5 '15 at 5:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .