I’m stuck in the section “File Descriptors and Redirections” of the academy on the question “How many total packages are installed on the target system?”.
I’ve tried “apt list”, “apt list --installed”, “dpkg -l”, “dpkg-query -l” and “dpkg-query -W” and piped the result of them to wc. But none of the answers seem to be correct.
Could anyone please lead me in the right direction?
Also, I’m not sure if it’s ok to post this Q with the commands I already tried, if that’s the case feel free to remove it.
I got stuck too in this lesson but at the end I figured even "apt list --installed | wc -l " works too! but it adds one to the actual output. cuz wc counts the lines and the first line of the output of “apt list --installed” is Listing…done.
When I tried to enter -1 or -|
The system didn’t recognize the command
Edit: (in the next section, the specify it as “-l” AKA lowercase L. Didn’t get to try that one)
The output also listed 3 numbers:
738 2949 55881
Subtracted 1 from the first number and got the answer, though I still don’t know why 3 numbers were listed.
Also, I’d love to know how to use this information in a theoretical attack