Getting rid of files with no ownership


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Getting rid of files with no ownership
# 1  
Old 12-15-2008
Getting rid of files with no ownership

I am in the process of learning how to do system administration (just on my own Linux machine) and have been working with the find command. One of the things I tried was

Code:
find / -nouser -o -nogroup

I redirected the output of my find query into a text file, and when I did a wc -l on it, it says the file has 127067 lines! Yikes. I also have done searches looking for group and world writable files as well as group and world writable directories. The results of the latter two searches were not as dramatic, but there were some 'hits'..

What would some of you do in a situation like this? Change all the ownerships to root? What about the writable files and directories?

I am running Gentoo Linux on an x86_64 machine.
# 2  
Old 12-16-2008
how about running this command instead?
Code:
find / -nouser -o -nogroup 2>/dev/null

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to check files ownership

Hi All, I wanted to check the files ownership and permission based on the path given it as arguments thru script. I was able to get the required command using ls but i would like this command to put in a script and check the file ownership against the what it needs to be and report back if... (12 Replies)
Discussion started by: Optimus81
12 Replies

2. UNIX for Advanced & Expert Users

SuSE-11 Ownership of files having root got changed

Hi Experts, I have create a new user with uid and gid as 0 in SuSE-11 Server. After that all the files having root owner ship are showing as new user name as owner. If I login as root, and type 'id' command, it also shows the new user. Sample output from my server. host:~ # id uid=0(test)... (4 Replies)
Discussion started by: vipinable
4 Replies

3. UNIX for Dummies Questions & Answers

how to get rid of last _ in the files name?

ex: I have list of files in a folder. abc_def_geh_.txt abc_.txt abc_def_geh_12345_.txt ab134c_d345345ef_444geh_12345_.txt i need to rename all files to get rid of the _ before .txt result should look like this: abc_def_geh.txt abc.txt abc_def_geh_12345.txt... (2 Replies)
Discussion started by: lv99
2 Replies

4. UNIX for Dummies Questions & Answers

Ownership of files in bin directory

When I checked to see who or what owns the files in my bin directory I noticed that some were owned by root while many others were owned by bin. Should I be concerned that there are files in this directory owned by bin or is bin the same as root as it pertains to limiting access to the files in... (3 Replies)
Discussion started by: j490428
3 Replies

5. UNIX for Advanced & Expert Users

command to copy files with original ownership

Hi, I need a command that to copy files from others and to keep files' ownership. Example: I copy file.txt from users "abc" to my local, and file.txt is own by user "abc" in local. Thanks in advance! (3 Replies)
Discussion started by: need_help
3 Replies

6. UNIX for Dummies Questions & Answers

100% ownership to files

ok. this is a bit complicated. i have a manager here who wants me to give another user access to all the files he owns. he wants this other user to have the same rights has he does. the problem has been that whenever the manager creates a new file the permissions on the files created... (3 Replies)
Discussion started by: Terrible
3 Replies

7. Linux

files ownership/permission problem

all the files and directories in my system are owned by root only.i try to(from root loggin) change the permission on the file but not permitted.can any one help to fix my problem .also while installing any software always error occur like no makefile available (1 Reply)
Discussion started by: jop
1 Replies

8. Shell Programming and Scripting

getting rid of duplicate files

i have a bad problem with multiple occurances of the same file in different directories.. how this happened i am not sure! but I know that i can use awk to scan multiple directory trees to find an occurance of the same file... some of these files differ somwhat but that does not matter! the... (4 Replies)
Discussion started by: moxxx68
4 Replies

9. UNIX for Dummies Questions & Answers

ownership of files

Hi, While changing ownerships from the root on a server i'm managing, i typed chown -R username:users * and it changed all ownership to username. Can someone tell me if there is someway I can set things back the way they were before? I can't even su username from the root. Am I going to just... (4 Replies)
Discussion started by: szhu
4 Replies

10. UNIX for Dummies Questions & Answers

How do I change ownership of a directory and all of it's files.

How do I change ownership of a directory and all of it's files without changing permissions? (1 Reply)
Discussion started by: mborin
1 Replies
Login or Register to Ask a Question