sfk count: how to count lines of cli output?

  • tifiliriki

    tifiliriki - 2012-03-15

    I want to use

    sfk count

    to count the number of lines of  any command line statements as for example:

    c:<>dir /s /b | sfk count

    But this doesn't work. Any suggestions for 'one-liners'?


  • tifiliriki

    tifiliriki - 2012-03-15

    Aargh, no options for preview or editing after posting!

    The 2nd grey box should read: c:\&gt;dir /s /b | sfk count

  • tifiliriki

    tifiliriki - 2012-03-15

    Solved, this works:
    c:\&gt;sfk run -yes "dir /s /b" +count

  • stahlworks

    stahlworks - 2012-03-16

    You may also use:

    dir /S /B | sfk filt -i -cnt

    where -i means to read input from the previous command, and -cnt prepends a counter, or

    dir /S /B | sfk filt -i +count

    to tell just the number of lines.

    if you just want to know the number of files in current dir and all sub dirs, then

    sfk list . +count

    tells this directly.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks