# FreeBSD port count?



## vadimkolchev (Sep 30, 2012)

Hi all,

I know that I can list all installed ports using pkg_info, but how can I list the number of installed ports?


----------



## wblock@ (Sep 30, 2012)

See wc(1).


----------



## vadimkolchev (Sep 30, 2012)

Thanks a lot, this worked.


----------



## Majorix (Sep 30, 2012)

`$ pkg_info | wc -l`


----------



## vadimkolchev (Sep 30, 2012)

Yes, I did exactly the same.


----------



## Majorix (Sep 30, 2012)

Sorry for not helping then


----------



## wblock@ (Oct 1, 2012)

If you want a quick scripting project, explain why that count is wrong and how to fix it.


----------



## vadimkolchev (Oct 1, 2012)

Sorry, you got me wrong. I just meant that I already done exactly that and succeeded. So the expression    pkg_info | wc - l    did the trick for me.


----------



## wblock@ (Oct 1, 2012)

Sorry, I was thinking pkg_info(1) showed some headers that would make the count incorrect.  But it does not, so never mind.


----------

