P1. Use command to list files in the lammps-7Aug19 directory
[u1@node1 lammps-7Aug19]$ find
Pt 2. Count the number of files by piping the list to wc to count the files.
[u1@node1 lammps-7Aug19]$ find | wc -l 14717
P3. 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
P4. 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
P5. 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
P6. Find empty files in the lammps-7Aug19 directory
[u1@node1 lammps-7Aug19]$ find -type f -empty
Pt 7. Find files or directories that belongs to username
[u1@node1 Downloads]$ find -type f -user root |wc -l 1572
References:
- The Linux Command Line