Linux ls command - case sensitive

When I view the contents of a directory, I'll use 'ls -l'.  However, the results are case sensitive.  For example, if I have a file called MyFile.txt:

ls -l /mnt/mountpoint/myfile* --> no results
ls -l /mnt/mountpoint/MyFile* --> shows the file

Sometimes I do not know if a file has upper case letters or not.  Is there a way to list the contents of a folder regardless of upper and lower case names?

Thanks

TB
LVL 3
TropicalBoundAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MazdajaiCommented:
There isn't an easy to list files case insensitivity with ls , I suggest try using grep:

ls -l |grep -i myfile

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TropicalBoundAuthor Commented:
OK.  That works.  Is there another command to list files besides ls?
0
MazdajaiCommented:
There are probably alternatives ... but not all Linux versions ship with them natively.

Specifically what feature are you looking for?
0
TropicalBoundAuthor Commented:
I have a need to search a Windows Server folder for text files containing the user's first initial and last name.  Most of the time, the file name is all lower case, but occasionally the first two letters are capitalized.  ls -l /mnt/mountpoint | grep -i jdoe* is a little bulky compared to the Windows variant of dir \\server\share\jdoe*
0
MazdajaiCommented:
There is no case insensitive option you can turn on to to ignore case.

I am not aware any built-in alternative on top of my head. There may be 3rd party tools but require installation. (Case sensitivity is the nature of Linux environment.  )
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Routers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.