Different answers when trying to learn file numbers

Thanks both to Oliver and to Aristotle for taking the trouble to reply to my query. I'll have to take Aristotle's word that the difference between my second and third results, as implied by Oliver, was caused by /proc and /sys "files", since I don't know how to act on Oliver's suggestion to exclude those "directories" from my command. I printed out and tried to read the entire man page for "find", but that didn't overcome my ignorance. Thanks again, Leslie

* Leslie Katz <lesliek(a)ozemail.com.au> [2005-12-14 06:15]:
I don't know how to act on Oliver's suggestion to exclude those "directories" from my command. I printed out and tried to read the entire man page for "find", but that didn't overcome my ignorance.
That would be find / \( -path /proc -o -path /sys \) -prune -o -printf . | wc -c The commandline for find(1) is actually an expression with boolean conditions, AND/OR operators, parentheses etc. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>

A. Pagaltzis wrote:
* Leslie Katz <lesliek(a)ozemail.com.au> [2005-12-14 06:15]:
I don't know how to act on Oliver's suggestion to exclude those "directories" from my command. I printed out and tried to read the entire man page for "find", but that didn't overcome my ignorance.
That would be
find / \( -path /proc -o -path /sys \) -prune -o -printf . | wc -c
The commandline for find(1) is actually an expression with boolean conditions, AND/OR operators, parentheses etc.
or find / -xdev -type f | wc -l

* Perry Lorier <perry(a)coders.net> [2005-12-14 08:25]:
or find / -xdev -type f | wc -l
Which is only going to walk the root partition, ie it’ll probably miss all the files in his /home and maybe /usr (/tmp? /var? depends on his partioning scheme). Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>

find / ! -type d |grep -v "^/sys"|grep -v "^/proc" This will exclude the sys and proc systems from the output of find. Pretty brute force and there is probably a way of combining the two regex into one grep command. There may also be ways of doing it all inside find. Pehaps by using "-fstype ext3" or "! -wholename /sys* ! -wholename /proc*". Regards Leslie Katz wrote:
Thanks both to Oliver and to Aristotle for taking the trouble to reply to my query.
I'll have to take Aristotle's word that the difference between my second and third results, as implied by Oliver, was caused by /proc and /sys "files", since I don't know how to act on Oliver's suggestion to exclude those "directories" from my command. I printed out and tried to read the entire man page for "find", but that didn't overcome my ignorance.
Thanks again,
Leslie
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
participants (4)
-
A. Pagaltzis
-
Leslie Katz
-
Oliver Jones
-
Perry Lorier