LS command does not list the correct file

Hi,

I am logged into as root & inside the home directory of another user.

ls -a
[root@mymac user1]# ls -laq
total 44
drwx------   4 user1 adm 4096 Nov 23 05:10 .
drwxr-xr-x. 12 root     root   4096 Nov 22 13:05 ..
-rw-r--r--   1 user1 adm   18 Nov 22 13:05 .bash_logout
-rw-r--r--   1 user1 adm  193 Nov 22 13:05 .bash_profile
-rw-r--r--   1 user1 adm  231 Nov 22 13:05 .bashrc
drwxr-xr-x   3 user1 adm   17 Nov 22 13:05 .cache
drwxr-xr-x   3 user1 adm   17 Nov 22 13:05 .config
-rw-------   1 user1 adm   46 Nov 22 13:05 .k5login
-rw-r--r--   1 user1  adm  172 Nov 22 13:05 .kshrc
-rw-r--r--   1 root     root     18 Nov 23 05:10 .profile_new
-rw-------   1 user1 adm    8 Nov 23 07:36 .sh_history

Now when i say

ls -a "*profile*"
ls: cannot access *profile*: No such file or directory
ls -a *profile*
ls: cannot access *profile*: No such file or directory
ls -a *profile
ls: cannot access *profile: No such file or directory
ls -a profile
ls: cannot access profile: No such file or directory

I was expecting

to be displayed as an output to my ls command but none of the command yield any output.

uname -a
Linux mymac 3.10.0-327.36.1.el7.x86_64 #1 SMP Wed Aug 17 03:02:37 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Can you please suggest whats wrong ?

man bash :

1 Like

Like you pointed out ls -a .*profile* resolved the issue.

Thank you !!