Searching for a file by name or extensionsuggest change
To find files/directories with a specific name, relative to
$ find . -name "myFile.txt" ./myFile.txt
To find files/directories with a specific extension, use a wildcard:
$ find . -name "*.txt" ./myFile.txt ./myFile2.txt
To find files/directories matching one of many extensions, use the
$ find . -name "*.txt" -o -name "*.sh"
To find files/directories which name begin with abc and end with one alpha character following a one digit:
$ find . -name "abc[a-z][0-9]"
To find all files/directories located in a specific directory
$ find /opt
To search for files only (not directories), use
find /opt -type f
To search for directories only (not regular files), use
find /opt -type d