I want to have icon on desktop of my script so that whenever I click that icon my script runs.
ln -s /folder/of/the/script/script /home/yourusername/Desktop/linkname.desktop
ln is used to create link to files:
the -s switch tells the command to create a symbolic link, which means something very similar to MS windows shortcuts.
The first field is for full path of the target destination (in your case the script you wish to run clicking the icon on your desktop)
The second field is for the the path of the link you are creating, which in your case must be in desktop folder under your homedir.
A couple of final notes:
- Depending on your localization, your desktop folder may vary, in my case for example is under /home/username/Scrivania/ (i'm from Italy)
- The .desktop appendix in destination filename is needed to make destination file appear on desktop, given that you are using Unity as desktop manager (the default DM in latest ubuntu distros). Check that fits your DM also and amend as needed.