Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: number of files

Roy Schestowitz <newsgroups@xxxxxxxxxxxxxxx> writes:

>__/ [ Rita ] on Tuesday 14 March 2006 19:46 \__

>> Hi ,
>> Is there any command in linux to know how many files are in directory?
>> Thanks

>alias nfiles='find . -type f | wc -l'

That will of course recurse down the whole directory tree. Eg it tells how
many files in the directory, and all of the subdirectories. 

If you just want the number of entries in the current directory ls|wc
If you just want just the files the immediate directory
find /name/of/directory -maxdepth 1 -type f |wc
etc.


>I asked a similar question before:

>http://schestowitz.com/UseNet/2005/April_2005_1/msg00015.html

>See thread for more possibilities.

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index