Deleting a file I don't own


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Deleting a file I don't own
# 1  
Old 09-18-2003
Network Deleting a file I don't own

I have a directory with permissions set 777, and some gumby has dumped a bunch of files and directories in there.

I don't own the culprit files or directories, but do own the containing directory - Is there some way I can delete this other user's files?

The other interesting thing is that running ls -l I get a number instead of the owner's login name. I can't find any corresponding user ID in /etc/passwd - so I'm assuming the user no longer exists on the system, making it a little difficult to follow them up...

Thanks.
# 2  
Old 09-18-2003
Directory permissions only grant read/write/exe to the directory...

IF this is your personal directory, I would change the world and group permissions to 000 to prevent them access... then when they complain ask them to remove...

OR get the SA to move them since you are not the SA.



I too have seen the number for the fileowner instead of the userID. Not sure I remember why this can happen. In the case of useing the UID, I think it is a system related setup. Some systems allow for the UID to be interchanged... in reality it is the same thing.
# 3  
Old 09-18-2003
If this way my directory, I would just remove the file.
Smilie

To delete a file you need write permission on the directory. So you should be able to just delete the file. The rm command will give you a warning, but you can override it. And you can use -f to suppress the warning.

I am depending here on your statement that the directory is 777. If it was 1777, then change may or may not change depending on your version of unix.

As for the numeric id, someone with permission to run chown can chown a file to any uid. But I usually see files like that on nfs mounted filesystems. The user would then have an accout on another system and created the file there.
# 4  
Old 09-18-2003
/agree perderabo

I didnt think of changing the permissions on teh files and then rm them...

If you truly do have 777 on the dir... Run "ls -ld . " and post it back here... then you can simply and easily remove them...

OR at least move them to /tmp if you dont want to destroy them...
# 5  
Old 09-19-2003
When I run ls -la I get:

drwxr-xr-x seiko group .
drwxr-xr-x seiko group ..
drwx------ 22866 difgroup not_my_dir



I want to remove the directory not_my_dir (and contained files, which I can't even see). While I may have ownership of the containing directory, I have no permissions for the directory I want to kill, therefore I can't just use "rm - rf not_my_dir".

Any other suggestions?
# 6  
Old 09-19-2003
Sorry, but this is not possible.

Only empty directories and files can be removed from a directory you have write permission of.

The one and only solution is ; get root.

Regs David
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

In the script I get additional file, which I don't expect do get

I have the following script #!/bin/sh Usage () { echo "Usage: $0 <config_file>" echo "Example: ./sftp_ondemand_daily.sh /export/data/mbsesb/config/ond emand.cfg /export/data/mbsesb/config/filename.lst" exit 1 } if then Usage fi ... (6 Replies)
Discussion started by: digioleg54
6 Replies

2. UNIX for Dummies Questions & Answers

Why I don't see the time in some file/directory?

Hi all, When doing an ls -l, why is it that I have the date and time on some of the files and directory, while others don't? :wall: Is there a way to show the date and time using a different command? OS is Linux and Solaris. Any response much appreciated. Thanks in advance. (1 Reply)
Discussion started by: newbie_01
1 Replies

3. Shell Programming and Scripting

Don't display file name

Hi I have a directory where i have 10 -12 files, i want to store word count in seperate file without any file name. i have written the logic which needs to be corrected filename.txt for i in /backup/temp/rajesh/12Apr2012_South *.LOG do #echo "File size of $i is" wc -l $i... (5 Replies)
Discussion started by: guddu_12
5 Replies

4. UNIX for Advanced & Expert Users

Don't find file from foxbase 2.1.2d

Hi there, finally i'm installed Sco Foxbase 2.1.2d over my Sco Open Server 5.0.7v server. Well at this point almost is working fine, but, when i Run mi application i receive the next error: "sh: the_name_of_file": does not exist". I checked it over the Hard Disk and the file exist, the... (1 Reply)
Discussion started by: danilosevilla
1 Replies

5. Shell Programming and Scripting

How to copy specific files when you don't know the file name?

I hope this isn't as silly as it sounds from the title of the thread. I have software that outputs files where the name starts with a real number followed by underscore as a prefix to an input file name. These will list in the directory with the file with the smallest real number prefix as the... (5 Replies)
Discussion started by: LMHmedchem
5 Replies

6. Shell Programming and Scripting

Deleting files that don't contain particular text strings / more than one instance of a string

Hi all, I have a directory containing many subdirectories each named like KOG#### where # represents any digit 0-9. There are several files in each KOG#### folder but the one I care about is named like KOG####_final.fasta. I am trying to write a script to copy all of the KOG####_final.fasta... (3 Replies)
Discussion started by: kmkocot
3 Replies

7. Shell Programming and Scripting

capture the last file when you don't know the all name

I have to ftp a file from a directory in Windows, I need to be able to ftp the last file that was put in the directory, the only thing I know about that file is that the 4 first digits are always the same (3520) then it is a _5(more digits), random digits, so it will be something like this... (1 Reply)
Discussion started by: rechever
1 Replies

8. UNIX for Dummies Questions & Answers

compress/decompress don't take you back to the same file

Hi there, I have a file system.tgz. I want to make changes inside this archive but before that, I want to be sure I recompress it in the exact same format. So I did the following: me:~# # Duplicate the archive --------------------------------- me:~# cp system.tgz system.01.tgz me:~# ls -l... (4 Replies)
Discussion started by: chebarbudo
4 Replies

9. Shell Programming and Scripting

Rename a file if I don't know its exact original name?

Hi everyone, I will be downloading a file every day with the name in this format SCA20060303_17514_IN.TXT And I need to rename it to SCA20060303_IN.TXT Where "20060303" is the current date, and the "_17514" part will always be a 5-digit number that I will NOT know beforehand. I... (9 Replies)
Discussion started by: propel
9 Replies
Login or Register to Ask a Question