There is no direct command in linux to display the number of files in a directory. You can combine two commands through a pipeline to
view the number of all files in a directory. The command is as follows:
ls |wc -l
1. ls is to view all files in a folder Command
2. wc -l is a command to count the number of lines in a file.
3. The above two commands are superimposed, which is equivalent to counting the total number of files in the folder.
The number of files in the linux directory
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326360865&siteId=291194637
Recommended
Ranking