LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-16-2013, 11:48 AM   #1
CJennings87
LQ Newbie
 
Registered: Nov 2013
Posts: 5

Rep: Reputation: Disabled
wildcard metacharacters and options to the ls command


what is the command for all files that have exactly three letters in their filenames and end with either the letter "t" or the letter "h" in the /bin directory

I can put ls ???

I can put ls *[t,h]

But, I do not know how to combine it...
 
Old 11-16-2013, 11:59 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
See 'man bash' ("Pattern Matching").
 
1 members found this post helpful.
Old 11-16-2013, 12:14 PM   #3
mddnix
Member
 
Registered: Mar 2013
Location: Bengaluru, India
Distribution: Redhat, Arch, Ubuntu
Posts: 500

Rep: Reputation: 137Reputation: 137
Code:
ls /bin/??[th]
 
1 members found this post helpful.
Old 11-16-2013, 12:24 PM   #4
CJennings87
LQ Newbie
 
Registered: Nov 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks to both of you
 
  


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
[SOLVED] using wildcard with the sed s/// command IneptCoder Linux - Newbie 4 07-19-2013 10:39 AM
Can I use a wildcard when using the mailx command? 00mpa Linux - Newbie 7 02-25-2013 08:30 PM
Can I dereference a wildcard in a command? wjtaylor Linux - General 1 03-31-2011 11:19 AM
Using the CHOWN command with a wildcard. Skillz Linux - General 14 01-25-2010 10:42 AM
metacharacters "The Pipe command mikeinanson Linux - Newbie 4 03-11-2006 01:36 PM


All times are GMT -5. The time now is 02:50 AM.

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