Find files or directories only in Linux?
- Kalpana
- Aug 7, 2020
- 1 min read
For files only, use the type f switch.
Files only
find ./ -type f -name "qa*"
Output
./test/qatree.pdf
./test/qa.txt
Directories only
Add the type d option to locate directories only.
find ./ -type d -name "qa*"
Output
./home/qa
Comments