I’m running the find command to find certain files, but some files in sub-directories have the same name which I want to ignore.
I’m interested in files/patterns like this:
/dev/abc-scanner, /dev/abc-cash ....
The command:
find /dev/ -name 'abc-*'
What’s being returned:
/dev/abc-scanner
/dev/abc-cash
...
...
...
/dev/.udev/names/abc-scanner
/dev/.udev/names/abc-cash
I want to ignore the latter files: /dev/.udev/...
If you just want to limit the find to the first level you can do:
… or if you particularly want to exclude the
.udevdirectory, you can do:Note that
/devis the directory from the question; you will want to replace that with the directory you wish to search.