This question already has an answer here:
Im having trouble figuring out that, if I'm in let say the directory /home/test/test2 but I want to find the number of files in the /home directory, how would I do it.
I know how to do it if it was the other way around, like in your home directory, list files in /home/test/test2, you would do:
ls /home/test/test2 | wc -l
but how would I do it if I was in the test2 directory and wanted to find the number of files in the home directory.