LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to remove directory make by another user (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-remove-directory-make-by-another-user-4175471346/)

9gagarmy 07-29-2013 12:50 PM

How to remove directory make by another user
 
hi there i want to remove a folder make by another user and this folder have permission 777 but i can remove it. I think it because file owen and group owner but how i can change it with chown ?
ps: this directory under / directory :(

szboardstretcher 07-29-2013 12:53 PM

What are the permissions of the containing directory? You must have 'write' on the containing directory to be able to delete any of its contents.

geek@LQ 07-29-2013 01:58 PM

If you really need to remove the directory and other means to do so has failed then just become root and then you can remove it.

rm -rf directory

If you want to keep the directory but change ownership then type
Code:


chown -R user:group directory
# use the code if you want to change owner and group
chown -R user directory    # use the code if you want to change owner only

If you're using a distro like ubuntu or its derivatives, precede the command with sudo

Replace user and group with the desired name and group. The -R will applied to parent and sub directories within.


All times are GMT -5. The time now is 06:18 AM.