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 tried to move a file into the rubbish bin (because I followed some instructions about installing sage and it involved moving a file to that directory) and it gave me errors saying that I didn't have permission. Even though I'm signed in as an administrator.

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

Open a terminal with Ctrl-Alt-T and Use sudo like this.

cd /usr/local/src
sudo rm ./file-name

If you want to delete the entire content of a folder, you should use -r switch. like this:

cd /usr/local/src
sudo rm -r ./folder-name

Please, make sure you aren't deleting any system files. Also double check the file and folder name before hitting Enter key.

share|improve this answer
4  
I recommend never to use rm -r with a path containing a /. If you accidentally type a space in the middle, you might end up deleting the whole /usr tree or something. Rather, change to the parent directory first: cd /usr/local/src, check that it succeeded, sudo rm -r folder-name. –  Gilles Sep 28 '12 at 17:22
    
@Gilles thanks. edited as suggested –  Anwar Shah Sep 28 '12 at 17:24
    
Thanks a heap you two! You've done me a great service! –  Brenton Horne Sep 28 '12 at 17:36
1  
@BrentonHorne Can you consider accepting the answer? –  Anwar Shah Sep 28 '12 at 17:37
    
@BrentonHorne you can do this by clicking the gray tick icon at the left side of the answer. –  Anwar Shah Sep 28 '12 at 17:38
show 3 more comments

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.