Reputation: 22113
I run the commands and receive results as:
$ ls M*
ManagerGit
$ ls m*
ManagerGit
The problem is that dir ManagerGit
isn't on the the current directory,
Try the command:
$ ls | grep -i 'manage'
Manager
It's subdirectory of dir Manage
tree -L 2
...
├── Manager
│ └── ManagerGit
...
What's the mechanism behind it?
Upvotes: 1
Views: 66
Reputation: 2582
I always find ls -d M*
is quicker and easier to write (rather than find ...
) where -d
does the following:
-d, --directory
list directories themselves, not their contents
Upvotes: 1
Reputation: 272657
Because the shell expands ls M*
to ls Manager
- i.e. list the contents of the directory called Manager
.
ls
doesn't know how to filter. I suggest you do something like this:
find . -depth 1 -name 'M*'
Upvotes: 3