Create a Shortcut on your Mac Desktop to a Terminal command

I installed HTTrack, which uses the Terminal command webhttrack.

webhttrack works good, but instead of using Terminal, I want to run it by clicking an icon on my desktop.

These type of icons are called shortcuts. Here is how to add a shortcut to a Mac Desktop. Note that the program webhttrack is already installed.

Bring up Terminal on your Mac

Bring up Terminal on your Mac. All of these commands to be done using Terminal.

Proceed with Caution

You can seriously mess up your Mac if you do not know what you are doing in Terminal.

Terminal is for advanced users only. Terminal assumes you are an expert and does not do the “Does the user know what they are doing?” checks the GUI does.

Terminal assumes you are an expert. It will simply not question you, and will obey.

This a very powerful feature, but is a two-edged sword if Terminal is used carelessly.

Create a Shortcut to your Terminal command on your Mac Desktop

The terminal command webhttrack works good, but I want to just click a link on my Desktop to run HTTrack.

Enter the following in Terminal, then press the Enter key. It will take you to your Desktop folder in Terminal.

cd ~/Desktop
go to your Mac Desktop

We are now going to make a shortcut file to HTTrack. Call it whatever you want. I called it WgetHTTrack, so I will know it is related to both Wget and HTTrack.

Enter the following into Terminal, then press the Enter key.

nano WgetHTTrack
Terminal nano command to open a file

This will open up the text editor nano.

nano blank

Enter the following into it (or cut and paste):

#!/bin/bash

webhttrack
nano executable shortcut file

Press Ctrl-X.

Press Ctrl-X to get this

Then press Y for yes.

Press Y for yes to get this.

Ensure the filename is correct, then press the Enter key to finish saving the file. This will take you back to Terminal.

Press Enter to finish saving file

Now, we have a file, but it will not do anything. To make the shortcut file an executable file, enter the following into Terminal, then press the Enter key.

chmod u+x WgetHTTrack
chmod command to make file executable
chmod command has been executed

You now have a shortcut on your Desktop that you can double-click to bring up HTTrack.

Desktop shortcut

Scroll to Top