Article 593BB How to count lines from result o/p?

How to count lines from result o/p?

by
ddenial
from LinuxQuestions.org on (#593BB)
Hello All

I want to count how many packages are there in flathub. So I issued the following command. Since I have multiple installations, It will ask which path before showing output.

Code:$ flatpak remote-ls flathub
Remote flathub' found in multiple installations:
1) system
2) user
Which do you want to use (0 to abort)? [0-2]:If I give line count, I get this error
Code:$ flatpak remote-ls flathub | wc -l
error: No remote chosen to resolve flathub' which exists in multiple installations
4I resolved this by adding --user option
Code:$ flatpak --user remote-ls flathub | wc -l
1658
But hypothetically, what if I didn't had --user option, and I have to give some intermediate answer, how then should I counted lines?

I hope my question is clear?

Thankslatest?d=yIl2AUoC8zA latest?i=lwWruz4Wx7k:UTGLrt5kVJw:F7zBnMy latest?i=lwWruz4Wx7k:UTGLrt5kVJw:V_sGLiP latest?d=qj6IDK7rITs latest?i=lwWruz4Wx7k:UTGLrt5kVJw:gIN9vFwlwWruz4Wx7k
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments