2️⃣find command

Syntax - find [options] [path…] [expression]

1. Search file based on their size

 find /path/ -size 50M 
  • M for MB

  • k for KB

  • G for GB

  • c for bytes

2. Find a filetype in a given path

find /path/ -type f
  • f for file

  • d for directory

  • l for symbolic link

  • b for block device

  • s for socket

3. Ignore upper and lowercase in file name while searching files

4. Search files for a given user only

5. Search a file based on their permissions

6. Search all files that start with letter `a`

7. Search all files which are modified/created after last.txt file

8. Search all empty files in a directory

9. Find and delete empty files

10. Search all files whose size are between 1-50MB

11. Search 15 days old files

Last updated