‘l’ by itself is not a native bash command. I would suspect that you have that configured as an alias and they do not always work as expected unless you have been very careful in the way the alias is constructed.
Please show us the output of alias also done as root.
If you have that as an alias for your regular user and have switched to root without also switching the environment it can have an effect as well.
Given the output, I’m assuming that l is an alias to ls -l. I agree with @computersavvy that it’s hard to know what’s going on without knowing exactly what that alias does. But, I do have a guess as to what’s happening here.
If you have a directory named vsftpd under the etc directory you are working from, ls -l vsftpd* will expand to ls -l vsftpd/ — that is, it matches the directory name — and so will show you the contents of that directory. So, I betls -l vsftpd/vsftpd.conf, or at least ls -l vsftpd*/vsftpd.*, will work.
One thing you could do to prevent this confusion in the future is to make l be ls -ld, so that it will list directory names rather than contents. But that might be frustrating other times when looking in directories is what you want to do.
I think @mattdm clued in on the problem, one we all commonly trip over. From your etc directory where you were, do ls -ld vsftpd*. The “d” option won’t expand the directory, so @mattdm suspects you’ll see drwxr-xr-x ... vsftpd or similar as a directory.
Another approach would be to run find . -name vsfptd.conf which will explore from . and show the path to your file. And if you use the find command and want to use * or pattern matching metacharacters, be sure to put the file search name in quotes, -name "vsftpd*" for example, otherwise bash will do the matching and find won’t see it.
Thanks very much for your answers. And I do apologise, the alias for “l” is simply “ls -altr”. It does a simple directory listing. ( I noticed the “l” as a potential problem after I posted … ).
There is nothing funny here. The file exists in the /etc directory, not a subdir. And I can see it using a wildcard until it specifies the file too precisely. This is the result as root:
[aurel@offroar etc]$ ls vsftpd*
ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh
[aurel@offroar etc]$ ls vsftpd.*
ls: cannot access 'vsftpd.*': No such file or directory
[aurel@offroar etc]$ ls vsftpd.conf
ls: cannot access 'vsftpd.conf': No such file or directory