LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-29-2009, 01:00 AM   #1
Kilam orez
Member
 
Registered: Aug 2009
Location: India
Distribution: open suse, fedora
Posts: 33

Rep: Reputation: 15
Lightbulb unable to change the permission of a directory .


Hi dear all

During execution of my program a directory is created and i want to remove it but i am unable to remove it.I use following command ...

$ rm -r KS.ae
rm: descend into write-protected directory `KS.ae'?

Every time,when this directory is created,i have to use SU command.Only then i am able to remove it. Please tell me how to get rid of it.

Thanks in advance.

Kilam
 
Old 09-29-2009, 01:25 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
What is the user that program is running as?
 
Old 09-29-2009, 01:47 AM   #3
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
You are executing the program as root, hence you will need root permission to remove the directory since they are owned by root. Btw, to prevent this annoying confirmation
Quote:
rm: descend into write-protected directory `KS.ae'?
for every file in the directory/subdirectories use the f switch.

Code:
rm -rf KS.ae
 
Old 09-29-2009, 02:14 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
-f switch is really dangerous option. It should be used with care. It will not ask for your confirmation and will just delete forcefully. And if used with root privileges, it can create havoc.
 
Old 09-29-2009, 02:21 AM   #5
Kilam orez
Member
 
Registered: Aug 2009
Location: India
Distribution: open suse, fedora
Posts: 33

Original Poster
Rep: Reputation: 15
Unhappy rm -rf <directory>doesn't remov e

Quote:
Originally Posted by ~sHyLoCk~ View Post
You are executing the program as root, hence you will need root permission to remove the directory since they are owned by root. Btw, to prevent this annoying confirmation for every file in the directory/subdirectories use the f switch.

Code:
rm -rf KS.ae
hi...

rm -rf KS.ae is not removing the directory....following massage comes

rm -rf KS.ae
rm: cannot remove `KS.ae/pp.os': Permission denied
rm: cannot remove `KS.ae/0': Permission denied
rm: cannot remove `KS.ae/s': Permission denied
 
Old 09-29-2009, 02:24 AM   #6
Kilam orez
Member
 
Registered: Aug 2009
Location: India
Distribution: open suse, fedora
Posts: 33

Original Poster
Rep: Reputation: 15
Question how to remove the directory

Quote:
Originally Posted by linuxlover.chaitanya View Post
-f switch is really dangerous option. It should be used with care. It will not ask for your confirmation and will just delete forcefully. And if used with root privileges, it can create havoc.
hi...

so how can i remove my directory without using SU command.

thanks in advance

kilam
 
Old 09-29-2009, 03:14 AM   #7
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by Kilam orez View Post
hi...

so how can i remove my directory without using SU command.

thanks in advance

kilam
Code:
$ sudo rm (path)
For the long, relatively safe experience, and

Code:
$ sudo rm -f (path)
For a short, risky experience

There are risks in life -- the prior poster was only telling you to be careful. "rm -f (path)" is risky, it should only be used with care.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to change pen drive file permission linuxmandrake Ubuntu 2 08-29-2006 01:12 PM
unable to change directory in man 10.1 official ronss Mandriva 2 01-16-2005 02:03 AM
cant change directory permission? dwarf007 Linux - General 1 09-24-2004 10:35 AM
how to change exisitng files/directory permission from 755 to 770 mweil Linux - Newbie 3 07-01-2004 11:18 AM
Unable to change permission Joe Soap Linux - Newbie 9 12-31-2001 12:33 AM


All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration