find -name does not work as expected

Bug #115169 reported by Andrew Foster
4
Affects Status Importance Assigned to Milestone
findutils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

On my dapper system (findutils 4.2.27-1ubuntu1), the `find` program does not give me accurate results.

In my ~/test directory, I have one .txt file and one .asp file. In a subdirectory called includes, I have another .txt file and another .asp file. However, `ls` and `find` do not agree.

Where the files are:

  andy@schooler:~/test$ ls *.txt
  test.txt

  andy@schooler:~/test$ ls includes/*.txt
  includes/test.txt

  andy@schooler:~/test$ ls *.asp
  default.asp

  andy@schooler:~/test$ ls includes/*.asp
  includes/subscribe_inc.asp

The first problem is that running find from the root of the folder tree does not return "includes/subscribe_inc.asp" as expected.

  andy@schooler:~/test$ find . -name *.asp
  ./default.asp

Howeer, the .txt files are reported as expected:

  andy@schooler:~/test$ find . -name *.txt
  ./test.txt
  ./includes/test.txt

If I try to find the asp files from the from the parent directory however, it is correct.

  andy@schooler:~$ find test -name *.asp
  test/includes/subscribe_inc.asp
  test/default.asp

All files are owned by andy - modes on all dirs 755, all files 644.

Cheers

Revision history for this message
Markus Bertheau (mbertheau) wrote :

Try putting *.txt and *.asp in single quotes:

find . -name '*.asp'

Everything will work as expected.

This bug can be closed as invalid.

Revision history for this message
Andrew Foster (andrew-solutionsfirst) wrote :

Thanks Markus, apologies for the dud bug.

Changed in findutils:
status: Unconfirmed → Rejected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.