how to use terminal to remove item from dock Hi I have a shell script in my login item , which runs whenever i log in to my system . It does work completely but once it exits the terminal , it leaves the terminal shortcut on my dock and I don't want that I want my dock to be clean and want only my required application in it.Is there any command which I can keep at the end of my script so that once the script executes completely it also remove terminal from my dock.
Try to run the script with launchd instead. Save a property list like this as ~/Library/LaunchAgents/some.label.plist:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;some.label&lt;/string&gt;
  &lt;key&gt;Program&lt;/key&gt;
  &lt;string&gt;/path/to/script&lt;/string&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


It should run the script the next time you log in. Make sure the script is executable (chmod +x /path/to/script) and starts with a hashbang line (like #!/usr/bin/env bash).