force delete/remove and mass file permissions-setting
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Distribution: Dabble, but latest used are Fedora 13 and Ubuntu 10.4.1
Posts: 425
Rep:
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?
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'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.