Tree Command for MacShare
This post is a follow up to Murphy’s post on retrieving a remote file by email. The method described in that post requires you to know the path of the file you’re retrieving. You can use the information in this post to auto-generate a text file with the paths to all your files. Retrieve that file and you’ll have all the information you might need.
For some people the best thing about this post will be this:
find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
Enter that line in Terminal, hit return on your keyboard, and you’re pretty close to the tree command you loved so much in Windows. (Thanks to the unix.com forums for help with the find and sed commands. ) You can copy and paste the command, or download a shell script containing it here. You’ll need to make it executable.
Murphy posted last week about how to retrieve a file by email. The catch was that you needed to know the path of the file. This screencast will show you how to generate a text file listing all your files in a tree format. If you prefer, you can use this command:
That will also display files and folders, but the format is more conventional. Either command will accomplish our goal.
In the screencast Murphy has the find and sed command listed above inside a shell script. The output is redirected to a text file. You can retrieve that text file by email, just like you would any other file.
If you prefer, create a second Applescript like the one in this post. You could alter it to always send a hard-coded file: the file that lists all your files.
In the screencast, Murphy uses Lingon to configure launchd, which handles scheduling tasks you may have used cron for in the past.Watch Now | Permalink