Wildcards and Mint (noob problems)
I am trying to use wildcards with the ls command in mint, but it doesn't like them...
When I try 'ls f??g' I get the error 'ls: cannot access f??G: No such file or directory' I can use the * wildcard, it seems to work fine. The ? wildcard doesn't work at all. Is there something I should know about mint and its use of wildcards? I know, I know, total noob question! |
Hallo neveser
I am afraid your problem does not relate to mint. It relates to how reg expression works. What you will match is a file name that must start with f and must be four characters long and must end with G. You can easily test this by creating three files with the touch command, ex : touch fraG touch fsgG touch fjkkG the 2 first files should match ls -l f??G but not the last |
OK.
I created a file called frag. Now, if I want to list all files that are 4 letters that begin with f and end with g, what is the exact syntax for that? I'm trying 'ls f??g' and it returns an error. EDIT: It seems as though neither of the wildcards work. I don't understand this at all. I have a few png files on my system and when I type 'ls *.png' I get the error 'ls: cannot access *.png: No such file or directory' |
For me it works. Witch shell do you have?
I have bash! bash-3.2$ bash --versionbash --version GNU bash, version 3.2.17(1)-release Here is a link of reg exp http://www.regular-expressions.info/ good luck |
Hello,
In my version of Bash (GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)) it also works. Can you run the following command and post output here? Code:
shopt -p | grep glob Kind regards, Eric |
Sure!
Here is my output: Code:
bash-3.2# shopt -p | grep glob |
All times are GMT -5. The time now is 02:42 AM. |