LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-17-2011, 04:45 PM   #1
neveser
LQ Newbie
 
Registered: Jan 2011
Distribution: Mint (Julia)
Posts: 17

Rep: Reputation: 0
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!
 
Old 02-17-2011, 05:29 PM   #2
sysslack
Member
 
Registered: Feb 2006
Posts: 69

Rep: Reputation: 15
Wink

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
 
Old 02-17-2011, 06:44 PM   #3
neveser
LQ Newbie
 
Registered: Jan 2011
Distribution: Mint (Julia)
Posts: 17

Original Poster
Rep: Reputation: 0
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'

Last edited by neveser; 02-17-2011 at 07:55 PM.
 
Old 02-20-2011, 04:30 AM   #4
sysslack
Member
 
Registered: Feb 2006
Posts: 69

Rep: Reputation: 15
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
 
Old 02-20-2011, 04:49 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
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
to check if globbing options are activated in your shell. Also confirm if you're using bash or not.

Kind regards,

Eric
 
Old 02-24-2011, 04:55 PM   #6
sysslack
Member
 
Registered: Feb 2006
Posts: 69

Rep: Reputation: 15
Sure!
Here is my output:

Code:
bash-3.2# shopt -p | grep glob
shopt -u dotglob
shopt -u extglob
shopt -u failglob
shopt -u nocaseglob
shopt -u nullglob
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems installing Mint 10 infamshxr Linux - Laptop and Netbook 19 02-17-2011 04:39 AM
audio problems on linux mint 7 looneytuned64 Linux - Newbie 3 09-24-2009 06:13 PM
mint bootable disk problems sho gunn Linux - Newbie 2 08-23-2009 05:14 PM
Mint Display Problems ? crapper Linux - Newbie 6 11-02-2008 03:22 AM
Linux Mint: WOW problems. Nokturnl Linux - Newbie 1 02-17-2008 04:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration