Operating System - HP-UX
1834232 Members
2515 Online
110066 Solutions
New Discussion

Re: cannot ls with wildcards

 
george_57
Occasional Advisor

cannot ls with wildcards

Hi Experts,
Im trying to do an ls from a directory. A normal ls -al works fine giving correct results. But if I do an ls -al A* it does not show me the files that start with an "A" it says ls: No match.
I tried changing directory permissions, It still doesn't work with a wildcard. But if i do the same command with root it works (ls -al A*) . Could somebody help me
none
6 REPLIES 6
Julio Yamawaki
Esteemed Contributor

Re: cannot ls with wildcards

Hi George,

Can you send the output of ll -d ?
And ll /A* (with root), it seens to be a problem of permission and owners.
Steven E. Protter
Exalted Contributor

Re: cannot ls with wildcards

chmod -R uid:gid will handle the files in the subdirectory, but you need to be sure thats what you want as an outcome.

Sometimes I find I have to do an ls A*.* to get results, Don't ask me why, I don't know.

You should know that you can't ls any directory that doesn't have x (execute rights on it).

ls -la dirname

dirname x--x--x date

should be the output at the very least.

Nobody flame me if I didn't get the order right on the xrw part, its eary in the am here.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kurt Beyers.
Honored Contributor

Re: cannot ls with wildcards

Try to use single quotes: ls -al 'A*'

Kurt
Jose Mosquera
Honored Contributor

Re: cannot ls with wildcards

Hi,

If the owner of file or dir that beginng with A* don't have read permissions for a group where belong to user that you triying, never this user can't see anything.

Another possibility is that the file have bben created by mistake beginning with a non-printable character, try with "ls -al *A*"

Rgds.
A. Clay Stephenson
Acclaimed Contributor

Re: cannot ls with wildcards

There is one more possibility - you may have turned off the shell file name generation with a set -f command.
If it ain't broke, I can fix that.
Frank Slootweg
Honored Contributor

Re: cannot ls with wildcards

As far as I know, "No match." is a C shell message. That would explain why it works for root (because root uses a POSIX shell).

As Clay mentioned, you have probably turned of filename generation.

If you use a C shell, then see /etc/csh.login, .login and .cshrc if filename generation is turned off somewhere. If I remember correctly, the C shell term is "glob"/"globbing" or some such. Se the csh(1) manual page for details.