LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-20-2008, 06:30 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Post Can't Remove A File


I am on a RHEL 4 server and was looking under the / directory and noticed an add entry from a few days ago:

Code:
[root@lt2fs3 /]# ls -l
total 194
drwxr-xr-x    2 root root        4096 Dec 15 04:04 bin
drwxr-xr-x    4 root root        5120 Jan 18 18:09 boot
drwxrwsr-x   13 root ctia_admin  4096 Jan  2 09:44 builds
drwxr-xr-x    8 root root        5840 Jan 19 09:51 dev
drwxr-xr-x   80 root root       12288 Feb 19 04:03 etc
drwxr-xr-x  255 root root       12288 Feb 15 09:56 home
drwxr-xr-x    2 root root        4096 Aug 12  2004 initrd
drwxr-xr-x   12 root root        4096 Feb 19 04:03 lib
drwx------    2 root root       16384 Apr  5  2007 lost+found
drwxr-xr-x    3 root root        4096 Jan 19 09:51 media
drwxr-xr-x    2 root root        4096 Sep  5 12:33 misc
drwxr-xr-x    2 root root        4096 Aug 12  2004 mnt
drwxr-xr-x    5 root root        4096 May 30  2007 opt
dr-xr-xr-x   90 root root           0 Jan 19 04:50 proc
drwxr-x---    5 root root        4096 Feb 20 19:20 root
-rw-r--r--    1 root root       19167 Feb  6 13:23 root@10.1.1.10
drwxr-xr-x    2 root root       12288 Jan 19 10:57 sbin
drwxr-xr-x    1 root root           0 Jan 19 04:50 selinux
drwxr-xr-x    2 root root        4096 Aug 12  2004 srv
drwxr-xr-x    9 root root           0 Jan 19 04:50 sys
drwxrwxrwt    5 root root        4096 Feb 20 04:02 tmp
drwxr-xr-x   15 root root        4096 Apr  5  2007 usr
drwxr-xr-x   22 root root        4096 May 30  2007 var
I am unable to cat or vim this file nor can I delete it. I does not appear to auto complete when I try and do anything to root@...

Does anyone know what my options are...?
 
Old 02-20-2008, 06:33 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Try lsof root@10.1.1.10 and see if you can find out what process is using the file, then kill that process. After that, you should be able to delete it or whatever.

EDIT: You might need quotes around the filename since it has special characters.
 
Old 02-20-2008, 06:45 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by pljvaldez View Post
Try lsof root@10.1.1.10 and see if you can find out what process is using the file, then kill that process. After that, you should be able to delete it or whatever.

EDIT: You might need quotes around the filename since it has special characters.
I tried the following and no results came back. I ran in under the / directory however I don't think it matters...

Code:
[root@lt2fs3 /]# lsof "root@10.1.1.10"
Any thoughts?
 
Old 02-20-2008, 06:47 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Sorry, I'm not in front of my linux box. I'm a moron, it should be lsof | grep root@10.1.1.10 possibly with the quotes.

EDIT: Just for good measure, here's a good article on using lsof.

Last edited by pljvaldez; 02-20-2008 at 06:48 PM.
 
Old 02-20-2008, 06:58 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by pljvaldez View Post
Sorry, I'm not in front of my linux box. I'm a moron, it should be lsof | grep root@10.1.1.10 possibly with the quotes.

EDIT: Just for good measure, here's a good article on using lsof.
Thanks for the article on lsof. I get no response on the following command:

Code:
[root@lt2fs3 /]# lsof | grep "root@10.1.1.10"
 
Old 02-20-2008, 07:00 PM   #6
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
What if you just grep for "root"
 
Old 02-21-2008, 11:52 AM   #7
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Just out of curiosity, were you able to resolve this?
 
Old 02-21-2008, 12:12 PM   #8
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Nope - nothing seemed to have worked. Its strange. Its there listed as a file but the system can't address it I assume due to the special character in the name so I can't delete it either...sucks!
 
Old 02-21-2008, 12:22 PM   #9
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Can you delete it by inode number? Try ls -il to find out the inode number. Then delete it with find . -inum XXXXXX -exec rm -i {} \; (where XXXXX is the inode number).
 
Old 02-21-2008, 12:56 PM   #10
rg.viza
Member
 
Registered: Aug 2006
Posts: 74

Rep: Reputation: 15
try lsattr [filename]
if you see an i in there
try chattr -i [filename]
remember to escape the special characters in the file name so you get the name right.

i is the immutable flag

Once you chattr +i a file nothing can be done to it until you chattr -i it.

-Viz

Last edited by rg.viza; 02-21-2008 at 12:57 PM.
 
Old 02-21-2008, 11:18 PM   #11
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
[QUOTE
-rw-r--r-- 1 root root 19167 Feb 6 13:23 root@10.1.1.10
[/QUOTE]

As per my knowledge, I think that you were trying to do a scp from that machine to 10.1.1.10 and while doing so you have not placed a 'colon' after that. And that's why the file was created. That seems to be a binary file. Being root you should be able to delete it.

Regards,

--
Prasanta
 
Old 02-21-2008, 11:32 PM   #12
Manuel-H
Member
 
Registered: Apr 2003
Location: Singapore
Distribution: Slackware32/64, Ubuntu, Fedora, RHEL
Posts: 138

Rep: Reputation: 15
have u tried

rm ./root@10.1.1.10
or
rm ./"root@10.1.1.10"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File showing with ? when using ls -al. How to remove file with only ? tacdog Red Hat 1 09-18-2007 10:12 AM
Bash remove part of a file based on contents of another file bhepdogg Programming 4 01-31-2007 03:13 PM
How to remove this file? cqmyg5 Slackware 10 06-11-2006 12:38 AM
how to remove file -T odious1 Linux - General 1 08-11-2005 12:29 PM
c++ file processing -- how to remove a record from a file sharonyiisl Programming 4 09-26-2004 03:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration