Use command to list files in the lammps-7Aug19 directory
[u1@node1 lammps-7Aug19]$ find
Count the number of files by piping the list to wc to count the files.
[u1@node1 lammps-7Aug19]$ find | wc -l
14717
Count the the directories listing by piping the list to wc to count the directories
[u1@node1 lammps-7Aug19]$ find -type d | wc -l
672
Count the list of files that matched the wildcard pattern *.mov that are larger than 1M by piping to wc to count
[u1@node1 lammps-7Aug19]$ find -type f -name "*.jpg" -size +1M |wc -l
Find and match files or directories whose contents or attributes were last modified more recently than those of “mybasefile”
[u1@node1 lammps-7Aug19]$ find -type f -name "*.jpg" -cnewer mybasefile
Find empty files in the lammps-7Aug19 directory
[u1@node1 lammps-7Aug19]$ find -type f -empty
Find files or directories that belongs to username
[u1@node1 Downloads]$ find -type f -user root |wc -l
1572
References:
- The Linux Command Line