find command not working

Hi,

Having issues with the . parameter in the find command.

Issuing "find . -name \*.pl" gives me
find: cannot open .: No such device

I got it working by substituting . with , so "find * -name \.pl" gives the correct listing.
bin/test.pl

"which find" lists /bin/find.

Anybody know how to reset the find command to normal ?

Thanks,
James.

What os and version are you using? What does "ls -ld ." show?

I'm on SunOS.

uname -a gives
SunOS hasas22 5.8 Generic_108528-24 sun4u sparc SUNW,Ultra-80

ls - ld shows
ls -ld
d--------- 11 jabrady cc6092 2048 Jun 1 12:20 .

You do not have read permission and execute permission on the current directory.

chmod 600 .

OK sorry, didn't think that wuold make any difference as "find * -name \*.pl" worked.

I have now set the file permission to 600.

ls -ld now shows the following:
ls -ld
drw------- 11 jabrady cc6092 2048 Jun 1 12:20 .

Thanks

Actually I meant "chmod 500 .". I am on a 5.8 box and I cannot recreate your sequence of events. What kind of filesystem are you using? If you don't mind, go back to that directory and do the following commands...
df -t . ..
/usr/sbin/mount | grep `/usr/bin/pwd`

Hi,

As far as I know I'm on an AFS file system.

Have changed the chmod to 500

hasas22 /ms/user/j/jabrady 132$ ls -ld
dr-x------ 10 jabrady cc6092 2048 Oct 4 15:40 .

df -t shows
hasas22 /ms/user/j/jabrady 133$ df -t
/ (/dev/vx/dsk/rootdg/rootvol): 1546936 blocks 485600 files
total: 1971878 blocks 491520 files
/dev/fd (fd ): 0 blocks 0 files
total: 0 blocks 127 files
/etc/mnttab (mnttab ): 0 blocks 0 files
total: 0 blocks 1 files
/var (/dev/vx/dsk/rootdg/varvol): 4859914 blocks 607487 files
total: 8382648 blocks 722476 files
/afscache (/dev/vx/dsk/rootdg/afscache): 273994 blocks 24517 files
total: 1210342 blocks 72960 files
/var/run (swap ): 26215152 blocks 433621 files
total: 26215216 blocks 434524 files
/ms (AFS ): 18000000 blocks 9000000 files
total: 18000000 blocks 9000000 files
/tmp (swap ): 26215152 blocks 433621 files
total: 26493120 blocks 434524 files
/d/d1 (/dev/vx/dsk/hasas22.gnr.0/gnr.0): 3398104 blocks 106186 files
total: 33554432 blocks 137904 files
/d/d2 (/dev/vx/dsk/hasas22.gnr.0/gnr.1): 18466128 blocks 577055 files
total: 33554432 blocks 588992 files
/d/d3 (/dev/vx/dsk/hasas22.gnr.0/gnr.2): 22717112 blocks 709901 files
total: 35363560 blocks 732768 files
/a/lnn6f4/vol/lnn6f4v1/misharu-qa(lnn6f4:/vol/lnn6f4v1/misharu-qa): 1035744 blocks 31167927 files
total: 1048576 blocks 31169604 files
/a/lnn6f4/vol/lnn6f4v1/secam_bank_data(lnn6f4:/vol/lnn6f4v1/secam_bank_data): 16721808 blocks 31167927 files
total: 16777216 blocks 31171621 files
/a/lnn6f4/vol/lnn6f4v1/intrepid_data(lnn6f4:/vol/lnn6f4v1/intrepid_data): 121960 blocks 31167927 files
total: 52428800 blocks 31243929 files
/a/lnn6f1/vol/lnn6f1v1/it_prod(lnn6f1:/vol/lnn6f1v1/it_prod): 35414648 blocks 30500634 files
total: 41943040 blocks 30596409 files
/a/ln1anf02/d/ln1anf02/d1(ln1anf02:/d/ln1anf02/d1): 5579344 blocks 174340 files
total: 33554432 blocks 361824 files
/a/ln1anf01/d/ln1anf01/d2(ln1anf01:/d/ln1anf01/d2): 6894568 blocks 215440 files
total: 33554432 blocks 427568 files
/a/ln1bnf02/d/ln1bnf02/d1(ln1bnf02:/d/ln1bnf02/d1): 18553744 blocks 289875 files
total: 67108864 blocks 469952 files
/a/lnn6f1/vol/lnn6f1v1/sutra_data(lnn6f1:/vol/lnn6f1v1/sutra_data): 5711632 blocks 30500634 files
total: 62914560 blocks 30690009 files
hasas22 /ms/user/j/jabrady 134$

The mount command shows:
hasas22 /ms/user/j/jabrady 143$ /usr/sbin/mount
/ on /dev/vx/dsk/rootdg/rootvol read/write/setuid/intr/largefiles/onerror=panic/dev=2140000 on Sun Oct 2 06:18:55 2005
/dev/fd on fd read/write/setuid/dev=5700000 on Sun Oct 2 06:18:58 2005
/etc/mnttab on mnttab read/write/setuid/dev=57c0000 on Sun Oct 2 06:18:58 2005
/var on /dev/vx/dsk/rootdg/varvol read/write/setuid/delaylog/largefiles/qio/ioerror=mwdisable/dev=2140007 on Sun Oct 2 06:19:00 2005
/afscache on /dev/vx/dsk/rootdg/afscache read/write/setuid/intr/largefiles/onerror=panic/dev=2140006 on Sun Oct 2 06:19:01 2005
/var/run on swap read/write/setuid/dev=1 on Sun Oct 2 06:19:01 2005
/ms on AFS read/write/setuid/dev=1234 on Sun Oct 2 06:19:21 2005
/tmp on swap read/write/setuid/dev=2 on Sun Oct 2 06:19:36 2005
/d/d1 on /dev/vx/dsk/hasas22.gnr.0/gnr.0 read/write/setuid/delaylog/largefiles/qio/ioerror=mwdisable/dev=21582b8 on Sun Oct 2 06:19:36 2005
/d/d2 on /dev/vx/dsk/hasas22.gnr.0/gnr.1 read/write/setuid/delaylog/largefiles/qio/ioerror=mwdisable/dev=21582b9 on Sun Oct 2 06:19:36 2005
/d/d3 on /dev/vx/dsk/hasas22.gnr.0/gnr.2 read/write/setuid/delaylog/largefiles/qio/ioerror=mwdisable/dev=21582ba on Sun Oct 2 06:19:36 2005
/a/lnn6f4/vol/lnn6f4v1/misharu-qa on lnn6f4:/vol/lnn6f4v1/misharu-qa remote/read/write/setuid/dev=584000d on Mon Oct 3 00:05:11 2005
/a/lnn6f4/vol/lnn6f4v1/secam_bank_data on lnn6f4:/vol/lnn6f4v1/secam_bank_data remote/read/write/setuid/dev=584001c on Mon Oct 3 09:15:13 2005
/a/lnn6f4/vol/lnn6f4v1/intrepid_data on lnn6f4:/vol/lnn6f4v1/intrepid_data remote/read/write/setuid/dev=5840022 on Mon Oct 3 10:07:55 2005
/a/lnn6f1/vol/lnn6f1v1/it_prod on lnn6f1:/vol/lnn6f1v1/it_prod remote/read/write/setuid/dev=5840029 on Mon Oct 3 11:50:16 2005
/a/ln1anf02/d/ln1anf02/d1 on ln1anf02:/d/ln1anf02/d1 remote/read/write/setuid/dev=584002b on Mon Oct 3 12:04:23 2005
/a/ln1anf01/d/ln1anf01/d2 on ln1anf01:/d/ln1anf01/d2 remote/read/write/setuid/dev=5840048 on Tue Oct 4 00:07:02 2005
/a/ln1bnf02/d/ln1bnf02/d1 on ln1bnf02:/d/ln1bnf02/d1 remote/read/write/setuid/dev=5840050 on Tue Oct 4 03:00:07 2005
/a/lnn6f1/vol/lnn6f1v1/sutra_data on lnn6f1:/vol/lnn6f1v1/sutra_data remote/read/write/setuid/dev=584005f on Tue Oct 4 13:46:31 2005
hasas22 /ms/user/j/jabrady 144$

However the `/usr/bin/pwd` is not in the returned data and cannot be grepped out.
hasas22 /ms/user/j/jabrady 144$ /usr/sbin/mount|grep `/usr/bin/pwd`
hasas22 /ms/user/j/jabrady 145$

Thanks

Well, good grief. You need to volunteer info like that. AFS does not use conventional Unix permissions for most stuff. In your case, and only with AFS directories, you need read permission. A program like find uses a directory as a data file. It needs to open it and read it. That is why find was not working. You apparently have lookup permission on the directory and that is good enough more most stuff. But programs like find and ls need to be able to read directories as well.