Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Send Terminal output to iCloud UNIX
Imagine that you run a script automatically on your Mac, and that you want to check the result of that script. There are many ways you could do this, such as remotely connecting to the Mac, or sending the results by e-mail. But with iCloud, you can also save the output to a file and put it on iCloud, where you can access it with your favorite iCloud-compatible text editor on another Mac, or on an iOS device.

To do so, simply send the output of the script to a file like this:

~/Library/Mobile\ Documents/com\~apple\~TextEdit/Documents/filename.txt

So, to save a list of a directory's contents, you'd use this:

ls -al > ~/Library/Mobile\ Documents/com\~apple\~TextEdit/Documents/list.txt

That saves a file called list.txt in TextEdit's Documents folder. Look inside the ~/Library/Mobile\ Documents folder for the paths to other apps you have that can use iCloud. Each folder in the Mobile Documents folder has a Documents sub-folder. Depending on the app, you may be able to access the files on another Mac or on iOS.
  • Currently 2.80 / 5
  You rated: 1 / 5 (5 votes cast)

Send Terminal output to iCloud | 4 comments | Create New Account
Click here to return to the 'Send Terminal output to iCloud ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Send Terminal output to iCloud
Authored by: rocteur on Aug 22, '12 02:20:08AM

Thats nice, so now I'm on my iPad or iPhone and I want to see the output ???

[ Reply to This | # ]
Send Terminal output to iCloud
Authored by: r-spx on Aug 22, '12 07:35:58AM

You'd probably have to create a script to squirt the data into a Note, if you wanted to view it on a iOS device.

And an AppleScript within a shell script is a better way of doing this. Writing files directly to the Mobile Documents folder might work fine, but isn't how you're supposed to do it. Those folders are there for apps, not for users to play with.

I think it's a very foolish thing to do that could easily break your iCloud setupů And have you ever seen a "Reset iCloud" button anywhere? Exactly. You really don't want to spend your life on the phone to Apple's tech support line.

[ Reply to This | # ]
Send Terminal output to iCloud
Authored by: osxpounder on Aug 23, '12 01:12:01PM

Instead of foolish, it might be better to say risky.

We don't know whether it's foolish... yet. We don't even know if it's risky.

Apple Support Communities are a pain in the ___.

[ Reply to This | # ]
Send Terminal output to iCloud
Authored by: kirkmc on Aug 22, '12 01:02:51PM

As I say in the hint, if you want to see it on iOS, you need to save the output to a folder for an iOS text editor.

Mac OS X Hints editor - Macworld senior contributor

[ Reply to This | # ]