fcount

count files in a directory
git clone git://z3bra.org/fcount
Log | Files | Refs | README | LICENSE

README (763B)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
┏━╸┏━╸┏━┓╻ ╻┏┓╻╺┳╸
┣╸ ┃  ┃ ┃┃ ┃┃┗┫ ┃
╹  ┗━╸┗━┛┗━┛╹ ╹ ╹
                -- by z3bra
===========================

fcount counts the number of files within a directory, and outputs the total to
stdout.

It basically does the same thing as `ls -lA|wc -l`, but ten times faster.

    ───── time fcount ~
    59

    real    0m0.001s
    user    0m0.000s
    sys     0m0.000s

    ───── time ls -Al ~|wc -l
    60

    real    0m00m0.010s
    user    0m00m0.010s
    sys     0m00m0.003s

Moreover, it gives the GOOD total (`ls -Al` gives you an extra line).
This could be useful within a status bar ..

    echo "mails: `fcount ~/mail/INBOX/new`" | bar

Be creative!