Unix Shell - unable to rm hidden file

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > January 2006 > unable to rm hidden file





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author unable to rm hidden file
stingray

2006-01-20, 8:13 am

Hi folks,
I try to delete the hidden file. It seem that
rm can identify the hidden file but the file still exist.
Could someone please advise me

Cheers,
Ray

bash-2.03 $ ls -lart
total 160
-rwxrwxrwx 1 xxxx mixsig 49152 Jan 9 17:30 .nfs735F
drwxrwsr-x 13 xxxx mixsig 2048 Jan 20 09:58 ..
drwxrwsrwx 2 xxxx mixsig 23552 Jan 20 10:06 .
bash-2.03 $ \rm -rfi .nfs735F
rm: remove .nfs735F (yes/no)? y
bash-2.03 $ ls -lart
total 160
-rwxrwxrwx 1 xxxx mixsig 49152 Jan 9 17:30 .nfs835F
drwxrwsr-x 13 xxxx mixsig 2048 Jan 20 09:58 ..
drwxrwsrwx 2 xxxx mixsig 23552 Jan 20 10:06 .

No_One

2006-01-20, 8:13 am

On 2006-01-20, stingray <raymond.tan@mymeth.com> wrote:
> Hi folks,
> I try to delete the hidden file. It seem that
> rm can identify the hidden file but the file still exist.
> Could someone please advise me
>
> Cheers,
> Ray
>
> bash-2.03 $ ls -lart
> total 160
> -rwxrwxrwx 1 xxxx mixsig 49152 Jan 9 17:30 .nfs735F <<<<<<
> drwxrwsr-x 13 xxxx mixsig 2048 Jan 20 09:58 ..
> drwxrwsrwx 2 xxxx mixsig 23552 Jan 20 10:06 .
> bash-2.03 $ \rm -rfi .nfs735F
> rm: remove .nfs735F (yes/no)? y
> bash-2.03 $ ls -lart
> total 160
> -rwxrwxrwx 1 xxxx mixsig 49152 Jan 9 17:30 .nfs835F <<<<<
> drwxrwsr-x 13 xxxx mixsig 2048 Jan 20 09:58 ..
> drwxrwsrwx 2 xxxx mixsig 23552 Jan 20 10:06 .
>


The file names are different............You did delete it, a program created
it again with a different file name.....don't delete it, something is using
it or needs it!!!!

ken

romy

2006-01-20, 6:03 pm

these filese are temp files created by the process. i too suggest you
not to delete these files. i think the number present in name of these
file is the process id of the process which created theze files.

Keith Thompson

2006-01-20, 6:03 pm

"stingray" <raymond.tan@mymeth.com> writes:
> I try to delete the hidden file. It seem that
> rm can identify the hidden file but the file still exist.
> Could someone please advise me
>
> Cheers,
> Ray
>
> bash-2.03 $ ls -lart
> total 160
> -rwxrwxrwx 1 xxxx mixsig 49152 Jan 9 17:30 .nfs735F
> drwxrwsr-x 13 xxxx mixsig 2048 Jan 20 09:58 ..
> drwxrwsrwx 2 xxxx mixsig 23552 Jan 20 10:06 .
> bash-2.03 $ \rm -rfi .nfs735F
> rm: remove .nfs735F (yes/no)? y
> bash-2.03 $ ls -lart
> total 160
> -rwxrwxrwx 1 xxxx mixsig 49152 Jan 9 17:30 .nfs835F
> drwxrwsr-x 13 xxxx mixsig 2048 Jan 20 09:58 ..
> drwxrwsrwx 2 xxxx mixsig 23552 Jan 20 10:06 .


As the name implies, that's a file created by an NFS server.

On a locally mounted file system, removing a file removes the
directory entry, but doesn't necessarily delete the file itself; the
file remains on the disk as long as there's a hard link to it, or as
long as some process has it open. In the latter case, the file still
occupies space on the disk, but there is no directory entry for it and
it has no name. When the process using the file closes it, the file
itself is removed (i.e., the disk space is deallocated).

If you remove a file on an NFS server that another process is using,
the server needs to keep the file so the process can continue using
it, but since NFS doesn't provide access to the raw disk, it needs to
assign a name to the hidden file. You removed the directory entry for
".nfs735F", and the server immediately created a new directory entry
".nfs835F". It will continue doing so until the file is no longer
being used.

(I'm not an expert on NFS; I'm sure someone will correct me on
whatever details I've gotten wrong.)

If you examine the contents of the file, you may be able to guess what
process is using it. You *might* be able to use something like lsof
to find out for sure.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Barry Margolin

2006-01-21, 2:49 am

In article <lnslrifxdw.fsf@nuthaus.mib.org>,
Keith Thompson <kst-u@mib.org> wrote:

> As the name implies, that's a file created by an NFS server.
>
> On a locally mounted file system, removing a file removes the
> directory entry, but doesn't necessarily delete the file itself; the
> file remains on the disk as long as there's a hard link to it, or as
> long as some process has it open. In the latter case, the file still
> occupies space on the disk, but there is no directory entry for it and
> it has no name. When the process using the file closes it, the file
> itself is removed (i.e., the disk space is deallocated).
>
> If you remove a file on an NFS server that another process is using,
> the server needs to keep the file so the process can continue using
> it, but since NFS doesn't provide access to the raw disk, it needs to
> assign a name to the hidden file. You removed the directory entry for
> ".nfs735F", and the server immediately created a new directory entry
> ".nfs835F". It will continue doing so until the file is no longer
> being used.
>
> (I'm not an expert on NFS; I'm sure someone will correct me on
> whatever details I've gotten wrong.)


You're pretty close. It's created by the NFS client -- the NFS server
has no way of knowing what processes are using the file.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com