find command not working


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users find command not working
# 1  
Old 10-04-2005
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.
# 2  
Old 10-04-2005
What os and version are you using? What does "ls -ld ." show?
# 3  
Old 10-04-2005
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 .
# 4  
Old 10-04-2005
You do not have read permission and execute permission on the current directory.

chmod 600 .
# 5  
Old 10-04-2005
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
# 6  
Old 10-04-2005
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`
# 7  
Old 10-04-2005
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find command not working on AIX

Hello, I am running find command in an AIX Server to find last 7 days modified directories/files. >cd /usr/openv/netbackup/db/class >ls -l total 0 drwxr-xr-x 3 root system 256 May 28 2014 Catalog-Backup drwxr-xr-x 3 root system 256 Sep 18 2012 ... (4 Replies)
Discussion started by: rahul2662
4 Replies

2. Shell Programming and Scripting

Maxdepth option of find command not working

Can you please figure out what is the issue here $ find . -maxdepth 1 -type f -size 0 -print find: bad option -maxdepth please find the OS details $ uname -a HP-UX g5u1216 B.11.31 U ia64 2614088426 unlimited-user license Use code tags, thanks. (6 Replies)
Discussion started by: TomG
6 Replies

3. Shell Programming and Scripting

[Solved] Find command is not working

Hello Friends, I have a problem about a little script, when i run the following two lines one by one on CLI then they work well: /usr/bin/mkdir `perl -e 'use POSIX qw(strftime); print strftime "%Y-%m-%d",localtime(time() - 30*24*60*60);'` find . -type f -name "fuseesb.log.*" -mtime 30... (5 Replies)
Discussion started by: EAGL€
5 Replies

4. Shell Programming and Scripting

Working with FIND command

Hi , In /home/etc/files path ran the following command find . -name 'ABC*' | wc -l The output of the above command is 25 as expected In path /home path ran the following command find . -name '/home/etc/files/ABC*' | wc -l The output of the abvoe command is 0 . Why the above... (3 Replies)
Discussion started by: smile689
3 Replies

5. Shell Programming and Scripting

sed find and replace command not working

Hi, Am trying to replace a character '-' with 'O' in position 289 in my file but am not success with below command. sed 's/^\(.\{289\}\)-/\1O/' filename sed: 0602-404 Function s/^\(.\{289\}\)-/\1O/ cannot be parsed. Thanks in Advance Sara Video tutorial on how to use code tags in The... (9 Replies)
Discussion started by: Sara183
9 Replies

6. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

7. UNIX for Advanced & Expert Users

command for recently modified files - "find" command not working

I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Discussion started by: joe.mani
1 Replies

8. Shell Programming and Scripting

daystart option not working in find command

Hi, I am trying to list all the files created / modified today in a directory. With reference to this thread, https://www.unix.com/shell-programming-scripting/20324-capture-all-today-files.html I have used the below command to list all the files modified today. find . -daystart -type f... (8 Replies)
Discussion started by: arunkumarmc
8 Replies

9. Shell Programming and Scripting

find command not working

Hi all, find command not working for me in a perticular directory.The same command is working fine in any other directory. Following is the command i issued: find . -type f -print my question is , is it possbile to disable a command only for a perticular directory ??...of course... (4 Replies)
Discussion started by: panyam
4 Replies

10. UNIX for Dummies Questions & Answers

Find command not working as expected

I have a script with a find command using xargs to copy the files found to another directory. The find command is finding the appropriate file, but it's not copying. I've checked permissions, and those are all O.K., so I'm not sure what I'm missing. Any help is greatly appreciated. This is... (2 Replies)
Discussion started by: mpflug
2 Replies
Login or Register to Ask a Question