Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using Ubuntu 12.04 LTS, and I want "XnRetro.desktop" file to be removed from directory /usr/share/applications using terminal . How to do it ?

I am new into Linux & I know something like "rm" command is used, but I don't wanna risk as there are many other files too in it.

Regards.

share|improve this question
    
You should remove the application that installed that file, not just remove the .desktop file. –  Thomas W. Jun 2 '13 at 22:20
    
I don't wanna remove the application, I just want that application not to appear in Gnome menu (: –  Suyaargappamaareche Jun 2 '13 at 22:21
    
@Suyaargappamaareche you can edit the desktop file so it doensn't appear in the menu, without removing it entirely. I forget how, but I think it's pretty easy to figure out once you look inside the file. –  strugee Jun 2 '13 at 22:53

2 Answers 2

up vote 1 down vote accepted

I don't recommend you remove anything by hand from the /usr folder, but if you REALLY want to not listen to my recommendation you can remove it with this command:

sudo rm /usr/share/applications/XnRetro.desktop

But I really don't recommend that you remove things from /usr without removing whatever installed to there, because it can sometimes cause problems.

You might want to consider as an alternative moving the file so it has a .old extension. The method as outlined in another answer here, by Daniel, explains how to do this by using this command:

sudo mv /usr/share/applications/XnRetro.desktop /usr/share/applications/XnRetro.desktop.old

share|improve this answer
    
Thank you very much for helping out. I just wanna learn so I gotta test it (: –  Suyaargappamaareche Jun 2 '13 at 22:32
    
If you're anxious about removing files, make a habit of using "rm -iv" ... The "-i" (for interactive) will prompt you "yes/no" for every file, and "-v" (for verbose) adds a line of output confirming each deletion. –  Steven Kath Jun 2 '13 at 23:05
    
@StevenKath True, however if you're only removing one file there's no real need for interactive verbosity. –  Thomas W. Jun 2 '13 at 23:16
    
@TheLordofTime Of course, but the whole point of the question is the asker isn't familiar enough with Linux to know whether or not they're deleting just one file. ("I know something like "rm" command is used, but I don't wanna risk as there are many other files too in it.") In this case, I think "rm -iv" is a handy learning tool and safety net to get in the habit of using. –  Steven Kath Jun 2 '13 at 23:35

A more elegant solution would be using mv.
Type

sudo mv /usr/share/applications/XnRetro.desktop /usr/share/applications/XnRetro.desktop.old

This way you rename the file so it won't be recognized anymore and since the ending is not .desktop it won't show.

If you noticed anything is messed up because of the change you can just use mv again to rename the file to its original name.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.