bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: du enhancement request


From: Eric Blake
Subject: Re: du enhancement request
Date: Wed, 08 Oct 2008 20:20:09 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Rafal Maszkowski on 10/8/2008 3:16 PM:
> It happens to me that I need to count files in directories. du is a
> command which woud fit best to such task if it had an option "count
> number of files instead of number of bytes". It could be -i as in df -i.

Better than adding an extension that won't be widely available, how about
using an existing command?  For example:

find . | wc -l

is a close approximation and available on any POSIX system (it mishandles
files with embedded newlines in the name).  If you use GNU findutils, you
can use the more accurate:

find -printf - | wc -c

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjtalkACgkQ84KuGfSFAYA+YgCgjfFDKsqWKJIHaoBZPL0xhIz1
DVMAoL6oKOAXCSSYebisbCd0z2/5zI4J
=fUeu
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]