[Reprint] Linux Statistics folder, file statistics number of commands Linux folder, the file number of commands

Linux Statistics folder, the number of command

 
https://www.cnblogs.com/dbalightyear/p/11280217.html

 

# View the number of files in the current directory (does not include files in subdirectories)

ls -l | grep "^ -" | wc -l
number to view the files in the current directory # (include files in subdirectories) Note: R, represents the subdirectory

-lR LS | grep "^ -" | WC the -l
# to view the current number of files in the directory folder directory (subdirectory of the directory is not included), with the above-mentioned reason, if you need to see subdirectories, plus R

ls -l | grep "^ d" | wc -l
all the number of files in the specified directory # query prefix name of the current path
# eg: all statistics to all files in the "20161124" at the beginning of the catalog number

ls -lR 20161124*/|grep "^-"| wc -l

Parameters for each command to do something Remarks:
LS the -l
This command refers to a long list of output information in the specified directory (not specified then the current directory), R represents the subdirectory "file", the "file" means is a general term for directories, links, equipment, documents, etc.

grep "^ d" indicates a directory, "^ -" indicates file

wc -l
represents the number of lines of output statistics, because after the previous filtration has only an ordinary file, a directory or a file corresponding to one line, the line number information, statistics is the number of directories or files

# View the number of files in the current directory (does not include files in subdirectories)

ls -l | grep "^ -" | wc -l
number to view the files in the current directory # (include files in subdirectories) Note: R, represents the subdirectory

-lR LS | grep "^ -" | WC the -l
# to view the current number of files in the directory folder directory (subdirectory of the directory is not included), with the above-mentioned reason, if you need to see subdirectories, plus R

ls -l | grep "^ d" | wc -l
all the number of files in the specified directory # query prefix name of the current path
# eg: all statistics to all files in the "20161124" at the beginning of the catalog number

ls -lR 20161124*/|grep "^-"| wc -l

Parameters for each command to do something Remarks:
LS the -l
This command refers to a long list of output information in the specified directory (not specified then the current directory), R represents the subdirectory "file", the "file" means is a general term for directories, links, equipment, documents, etc.

grep "^ d" indicates a directory, "^ -" indicates file

wc -l
represents the number of lines of output statistics, because after the previous filtration has only an ordinary file, a directory or a file corresponding to one line, the line number information, statistics is the number of directories or files

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/12357197.html