I noticed a strange behaviour with linux find
utility
Here is my directory structure:
[root@machine test]# ls -lR
.:
total 4
drwxr-xr-x. 3 root root 4096 Aug 1 21:25 dir1
./dir1:
total 8
drwxr-xr-x. 2 root root 4096 Aug 1 21:24 dir2
-rw-r--r--. 1 root root 11 Aug 1 21:25 mgmt.py
./dir1/dir2:
total 8
-rw-r--r--. 1 root root 11 Aug 1 21:24 mgmt.py
-rw-r--r--. 1 root root 106 Aug 1 21:24 mgmt.pyc
If I try to find mgmt.pyc from top directory, I can see it in results
[root@machine test]# find . -name mgmt*
./dir1/mgmt.py
./dir1/dir2/mgmt.py
./dir1/dir2/mgmt.pyc
However, if I try to find it from one level below, it does not show up in results
[root@machine test]# cd dir1/
[root@machine dir1]# find . -name mgmt*
./mgmt.py
./dir2/mgmt.py
Am I using find
in an incorrect way or is it some other error?