We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

tylerhall on 05/04/07


Tagged

mac unix osx mount awk umount


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

basicmagic
kellyharding
nimoyjohnson


Unmount All AFP Network Shares


Published in: Bash 


This command will force all mounted AFP network drive to disconnect. I've set this to run automatically each time my laptop sleeps so that if I wake it up on a different network Finder won't freak out.

  1. mount | awk '/^afp_/ { system("umount -f " $3) }'

Report this snippet 

You need to login to post a comment.