LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   force delete/remove and mass file permissions-setting (https://www.linuxquestions.org/questions/linux-newbie-8/force-delete-remove-and-mass-file-permissions-setting-146087/)

moxieman99 02-14-2004 03:14 PM

force delete/remove and mass file permissions-setting
 
These are a force delete/remove and mass file permissions-setting information questions.

I have Redhat Linux 9.0 on a custom-built computer. Hardware is not an issue.

There are two users: Root and Individual. I have access to both

I copied a directory/folder/whatever from a CD onto Individual's desktop. It has multiple sub-folders and sub-sub-folders, so going through each sub-folder to change permissions and empty them out and then deleting them is not really an option.

When I log in as Root, I cannot see the Individual's directory, nor the desktop for the Individual.

1. What command(s) do I run while logged in as Individual (or Root, I don't care) to force a delete of the parent directory/folder and all of its sub-folders and files (the CD I copied)? Is there a particular directory on the Indivual user that I should be in (like desktop) in order to run the command?

I see reference to the rm -rf <directory name> command in various threads here, but I don't know if that is correct, or where I should be when I run it (I assume that if the folder is on the desktop, I should be in desktop and try to delete the folder associated to it.

2. What system setting changes can I make to make sure that permissions are automatically set to permit full user access when something is downloaded/installed/copied?

Thanks,

Moxieman99

drzap 02-15-2004 09:36 AM

The desktop you see when you log into a user is a folder in the users home directory named 'Desktop'. Usually the home folder for a user is /home/user_name (aka /home/~, since ~ means username).

If you copied a dir onto the desktop it is in the folder /home/~/Desktop
So if you want to delete this folder you open a shell cd to the /home/~/Desktop folder and run 'rm -rf dir_name' you should be very carefull with the rm -rf since it deletes everything you specifys it to delete without bothering about anything, but permissions..

Whenever you copy or install something it is set to be owned to the user you installed or copied it with.. so if you copy the cd using root into the users desktop it will belong to root, and only root may change the permissions of anything not belonging to the user you are... normally you have read pemissions to the files/folders, but if you want to get the full permissions to a file you should run 'chown' which, suprisingly enough, changes the owner..

So if you want the permissions of the folder /home/~/Desktop/foo and all the subdirectorys.. run:
chown -R username: /home/~/Desktop/foo
remeber to not add an '/' at the end since you then only will change the owner for the contents.

the -R option says that you would like to change the owner of all sub dirs..
the 'username:' specifys the username the ':' stands between the username and group, but if none is specified it uses the main group of the user so you could probably have written 'chown -R username:users /dir/subdir' and it would have the same result.. don't know what group you're part of..


To change a permission you may also use the commands: chattr, chgrp and chmod.. but as long as you own the files you have full access to them..

if you didn't know you may change into superuser(root) while logged in as the indivdual user with the command 'su'

moxieman99 02-15-2004 11:43 AM

Thank you!

Moxieman99


All times are GMT -5. The time now is 09:19 AM.