How do I Create a Macro or Shortcut to run a Command Sequence Terminal The following was posted by Codler as an answer to a question of read/write difficulties on NTFS drive which worked perfectly.

My question is, is there a way for a noob like me to create a shortcut method of running these steps in Terminal instead of typing it in each time I want to mount the drive?


  
  Plug-in your device
  Write in Terminal diskutil list and look for IDENTIFIER where TYPE is Windows_NTFS.
  
  In this case it is disk1s1
  Then run the following:

diskutil unmount /dev/disk1s1
cd /Volumes
mkdir Elements
sudo mount -w -t ntfs -o rw,nobrowse /dev/disk1s1 /Volumes/Elements
open /Volumes/Elements
You don't want the hard drive to show up in the Finder? I had a similar need in the past, and solved it by adding a line to /etc/fstab:

LABEL=&lt;disk label&gt; &lt;mount point&gt; ntfs auto,nobrowse


where:


&lt;mount point&gt; is the directory where you want to mount the hard drive, in your case /Volumes/Elements. I'd recommend, though, that you mount the drive elsewhere to prevent name collisions, as /Volumes is used by the Finder to mount removable drives. Let's say you choose /MyVolumes.
&lt;disk label&gt; is the hard drive name as it appears in the Finder, I guess Elements.


So, in your case, the line should read:

LABEL=Elements /MyVolumes/Elements ntfs auto,nobrowse


Now, /etc/fstab is a system file so care must be taken not to break anything:


Open Applications>Utilities>Terminal.
In Terminal, type:

sudo mkdir -p /MyVolumes/Elements


to create the folder /MyVolumes/Elements.
Now type:

sudo cp -a /etc/fstab /etc/fstab.bak
sudo cp /etc/fstab ~/Desktop/fstab.txt
sudo chown $(whoami) ~/Desktop/fstab.txt


Type your password when asked.

These commands: 1) create a copy of /etc/fstab you can fallback to if anything goes wrong, 2) copy /etc/fstab to your Desktop, 3) change ownership of the copy on your Desktop so that you can edit it.
Switch to the Finder, double click fstab.txt on your Desktop and add at the bottom of the file (the file is probably empty) the following:

LABEL=Elements /MyVolumes/Elements ntfs auto,nobrowse


Press ⌘S to save the file and ⌘Q to close the editor.
Back to Terminal, type:

sudo mv -f ~/Desktop/fstab.txt /etc/fstab


to overwrite /etc/fstab with your modified version.
Plug in your drive. Does it work? Great! It doesn't? Something went wrong... type in Terminal:

sudo mv -f /etc/fstab.bak /etc/fstab


to restore the original /etc/fstab.