Results 1 to 2 of 2

Thread: file-nr and lsof results

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default file-nr and lsof results

    Hi,
    I think file-nr gives no of open files in the system and lsof gives it per user.

    But I have root's no of open files > file-nr .

    How it is possible. pls correct me if I am wrong.

    bash-3.2# cat /proc/sys/fs/file-nr
    704 0 8192
    -bash-3.2# lsof -u root | wc -l
    872
    -bash-3.2# cat /proc/sys/fs/file-nr
    704 0 8192
    -bash-3.2# lsof -u root | wc -l
    877
    -bash-3.2# cat /proc/sys/fs/file-nr
    704 0 8192

  2. #2
    Junior Member tanvi's Avatar
    Join Date
    Jun 2011
    Location
    India
    Posts
    17
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Rep Power
    0

    Default

    Quote Originally Posted by rajatlr View Post
    Hi,
    I think file-nr gives no of open files in the system and lsof gives it per user.

    But I have root's no of open files > file-nr .

    How it is possible. pls correct me if I am wrong.

    bash-3.2# cat /proc/sys/fs/file-nr
    704 0 8192
    -bash-3.2# lsof -u root | wc -l
    872
    -bash-3.2# cat /proc/sys/fs/file-nr
    704 0 8192
    -bash-3.2# lsof -u root | wc -l
    877
    -bash-3.2# cat /proc/sys/fs/file-nr
    704 0 8192



    file-nr keeps the information about the number of "open file descriptors" that are "handles" to open files. But there might be open files that do not have handles. Hence, the difference.

    Take for example the output

    bash-3.2# cat /proc/sys/fs/file-nr
    704 0 8192
    -bash-3.2# lsof | wc -l
    1140

    Here, total number of files open are 1140, while only 704 of these have file descriptors (handles)

    Hope it helps. Cheers!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find Files By Size and Print Results
    By jaysunn in forum Getting started tutorials
    Replies: 3
    Last Post: 15th September 2010, 11:19 PM
  2. [Solved] Save Linux shell output results in mysql database
    By flipmode in forum Shell scripting
    Replies: 5
    Last Post: 8th July 2010, 03:45 PM
  3. [Tip] Check Load ON Multiple Linux Servers And Mail Results
    By jaysunn in forum Getting started tutorials
    Replies: 0
    Last Post: 29th September 2009, 12:55 AM
  4. Replies: 1
    Last Post: 16th March 2009, 07:41 PM
  5. Can't Open folder from Search Results
    By nabilalk in forum Ubuntu / Debian
    Replies: 0
    Last Post: 4th March 2009, 12:46 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •