LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ls -a *vim* does not find .vimrc notwithstanding it is there. (https://www.linuxquestions.org/questions/linux-newbie-8/ls-a-%2Avim%2A-does-not-find-vimrc-notwithstanding-it-is-there-890800/)

stf92 07-09-2011 11:53 AM

ls -a *vim* does not find .vimrc notwithstanding it is there.
 
As you can easily see:
Code:

semoi@darkstar:~$ ls .vimrc
.vimrc
semoi@darkstar:~$ ls -a *vim*
/bin/ls: cannot access *vim*: No such file or directory
semoi@darkstar:~$

What is my mistake?

weibullguy 07-09-2011 12:09 PM

Filenames beginning with a dot aren't matched by a glob. You can use the dotglob option to make the match. Excecute --> shopt -s dotglob then try again.

stf92 07-09-2011 12:40 PM

I could have issued the command but instead I went first to the bash manual where I found the shopt builtin command with its -s option (set or enable) and the dotglob optname. Thanks a lot.


All times are GMT -5. The time now is 08:31 PM.