We are doing this so we can get the drive identifier, which is typically something like disk1s2, or disk2s2, etc This will provide a list of all drives that are attached to the Mac, that are either mounted and unmounted, and all of their respective partitions.
The first thing you’ll need to do is list the connected drives. To do this you’ll need another volume attached or connected to the Mac in some form or another, then launch Terminal to get started (sits in /Applications/Utilities/).
How to Unmount a Drive from Command Line on Mac This is infinitely useful for troubleshooting situations, for scripting and automation, and it’s a great trick for those of us who just like to tinker around in Terminal. By using the command line to remount the drive, the entire process can be completed remotely if necessary through SSH, and without ever having to physically disconnect a drive from the Mac. This trick works with external USB disks, hard drives, Firewire, Thunderbolt, DVD’s, CD’s, network drives, even USB thumb drives, literally any volume that can be mounted and accessed through the incredibly helpful diskutil command. But what if you want to be able to mount, unmount, and remount drives from the command line? That’s exactly what we’ll cover here. Along the same lines, if you want to remount a drive you can usually just physically unplug the drive and plug it back again. As a workaround, start Sublime Text 2 first via Finder, and then interact with it using subl.For many users, the easiest way to unmount a drive in Mac is to either just drag a volume into the Trash, use the eject keys, disconnect the drive, or use one of the force eject methods. If you have the MacPorts version of Python installed, then starting Sublime Text 2 via the subl will not work correctly. Specifying -w will cause the subl command to not exit until the file is closed. To use Sublime Text 2 as the editor for many commands that prompt for input, set your EDITOR environment variable: To the terminal when a file is closed (only relevant if waiting for a file).įilenames may be given a :line or :line:column suffix to open at a specific
h or -help: Show help (this message) and exit s or -stay: Keep the application activated after closing the file b or -background: Don't activate the application w or -wait: Wait for the files to be closed before returning a or -add: Add folders to the current window
Ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl Assuming you've placed Sublime Text 2 in the Applications folder, and that you have a ~/bin directory in your path, you can run: The first task is to make a symlink to subl. This can be used to open files and projects in Sublime Text 2, as well working as an EDITOR for unix tools, such as git and subversion. Sublime Text 2 includes a command line tool, subl, to work with files on the command line. WARNING! This documentation is for an old, unsupported version