how do i nullify zero link files under /proc
please help me
/proc is a special folder. The files inside it don't really exist, they're listings provided by the kernel. There's nothing to nullify.
actually these zero link files are eating up disk space. if I do
> /proc/<pid>/fd/17356
it says permission denied.
if i take an example from another post,
find /proc/*/fd -type f -links 0 -size +10000 -ls
97442 12683 -r--r--r-- 0 hergp rzadmin 12935547 Sep 29 09:56 /proc/20251/fd/0
this is taking up 12 MB of disk space, then how do i free this 12 MB?
These files don't really exist in proc. /proc/ is a special folder provided by the kernel showing process statistics. /proc/fd/# lists files the process has open somewhere else. In Linux, these are symlinks that point to the real file. In whatever OS you have (which is something that'd be handy to know), it's shown as a read-only file.
You need to track down the real file.
/proc uses NO DISK. Period. The files exists somewhere else on disk. The process with pid=17356 has the disk file open. The file does not reside in /proc. /proc is a kernel representation of a file. The data for the file resides on a disk.
You can use lsof or fuser to find the actual name of the file.
One other note - if a process opens a file, then deletes the file but leaves the file open, the directory entry (how you find the actual file) is gone. You cannot see it. And as long as the process runs the disk space is consumed by the file. Once the last file descriptor that references the file is closed, the OS then deletes the now nameless file. This is what creates a zero hardlink file.