Contextual Menu Cleanup (OSX)

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

By: piXelz
2009-02-16 18:19:34

These Might Interest You

  • This will create rapidly an html menu. You can paste it in you're html page with the middle button(the wheel). I didn't test it in an html with css, but it seems alright. Show Sample Output

    for menu in {1..4}; do echo -e "<ul>\n <li>menu $menu</li>\n <ul>"; for items in {1..5}; do echo " <li>item $items</li>"; if [ $items -eq 5 ];then echo -e " </ul>";fi;done; echo "</ul>";done | xclip
    qcjn · 2013-09-22 06:34:32 0
  • The function will take a comma separated list of items to be 'selected' by xsel -i: smenu "First item to paste,Paste me #2,Third menu item" You will then be prompted to choose one of the menu items. After you choose, you will be able to paste the string by clicking the middle mouse button. The menu will keep prompting you to choose menu items until you break out with Control-C. Show Sample Output

    smenu() ( IFS=',' ; select x in $*; do echo "$x" | xsel -i; done )
    bartonski · 2010-02-08 15:33:53 4
  • I used this command (in addition to a code formatting tool) to "cleanup" a bunch of PHP files

    sed -i -e 's/[ \t]*$//;/^$/N;/\n$/D' sourcefiletocleanup
    bibe · 2012-02-10 11:09:54 0
  • Remove all commented lines Remove all blank lines Show the menu Up the delay so you have enough time to select a kernel Remove the quiet so you can watch the entire boot Add a rootdelay for san attached storage booting Show Sample Output

    sed -e '/^$/d' -e '/^#/d' -e '/initrd/ a\ ' -e 's/hiddenmenu//g' -e '/^timeout/d' -e '/default/ a\timeout\t\t15' -e 's/quiet//g' -e 's/splash/rootdelay=60/g' /boot/grub/menu.lst > /boot/grub/
    z0rk · 2011-06-28 08:03:17 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: