How do I check the download progress of Mountain Lion through the terminal?

I am downloading Mountain Lion, I know I can monitor download progress through the Mac App Store purchases screen but I want to know if I can monitor progress through Terminal.app using a shell command.


Sure - the storeagent uses a folder deep within /private/var/folders to hold the download progress.

On my Mac it's downloading to this folder below - yours may change, but you should be able to search for the com.apple.appstore using mdfind and use du or ls to see the file size grow.

/private/var/folders/tv/xyw2rpln7hq4gw2m0prg_src0000gn/C/com.apple.appstore/497799835

The App Store has a nicer wrapper on the progress with a time estimate, but with bc and other tools, you could do the same in a short shell script exercise.


If you can't locate your folder, this find command might be of use to narrow down your search....

sudo find /var/folders -type d -name com.apple.appstore -print

I decided that the best way to identify the file being downloaded was to write a small script that fetched the files held open by the App Store program storeagen.

#!/bin/bash
appstore_pid=$(ps -ef|grep storeagen|grep -v grep|awk '{print $2}')
lsof -p $appstore_pid|grep private|awk '{print $7 "\t" $9}'

I set appstore_pid variable to the PID of storeagen by extracting it from the ps command using grep and awk

Then I use lsof to list open files by the PID of storeagen and I print out the size of the files and the files path. If you do this several times in succession you can see the file(s) that's growing and make a good guess by its size that it is the OS download.