Monday, April 29, 2024
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 1059  / 2 Years ago, mon, march 7, 2022, 4:21:00

I need to see how many files I have on my whole system. Specifically, I need to count all files from / (so on the whole system), and I need to get a number at the end. So like there are 10000 files on the whole system.


How can I accomplish this?
I hope you can help!


More From » command-line

 Answers
1

You can use find / to list all the files. When find's output is redirected, it outputs file names containing newlines as spanning multiple lines, so you can't just count the lines. You can output something else for each file and count the characters, though:


sudo find / -type f -printf 1 | wc -c

Without sudo, you probably can't access all the paths, so you can't count all the files.


[#1159] Tuesday, March 8, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sertold

Total Points: 445
Total Questions: 123
Total Answers: 113

Location: Burundi
Member since Wed, Sep 28, 2022
2 Years ago
sertold questions
Wed, Dec 21, 22, 16:02, 1 Year ago
Fri, Dec 31, 21, 01:50, 2 Years ago
Thu, Jun 16, 22, 23:30, 2 Years ago
Tue, Mar 29, 22, 02:11, 2 Years ago
Mon, May 2, 22, 20:48, 2 Years ago
;