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 06-18-2009, 02:01 PM   #1
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 603

Rep: Reputation: 39
Talking ls question...


hi,

I have a folder which contains files as TLOgs21.090618.10801.REN where TLOgs21 is the name of the file being archive, 090618 the date when the file is being archived, 10801 some random number the servers gives to this file, REN the extension. I'm trying to figure out a way to for example list all the files from 090618 so I would do something like ls -lha TLOGs21.090618.?????.REN but I get ls: cannot access TLOGs21.090618.?????.REN: No such file or directory

I might be doing something wrong.. can you guys point me to the right direction?
thanks!

Last edited by ceantuco; 06-18-2009 at 02:04 PM.
 
Old 06-18-2009, 02:04 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
ls | grep 090618
 
Old 06-18-2009, 02:05 PM   #3
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 603

Original Poster
Rep: Reputation: 39
lol thanks it worked!
 
Old 06-18-2009, 02:13 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
No need for two commands.
ls TLOGs21.090618.*
 
Old 06-18-2009, 02:17 PM   #5
alinas
Member
 
Registered: Apr 2002
Location: UK, Sywell, EGBK
Distribution: RHEL, SuSE, CentOS, Debian, Ubuntu
Posts: 60

Rep: Reputation: 20
Indeed, you don't even need ls!

Since it's the shell that performs globbing (filename generation from wildcards), any command will do.

Try this: echo *090618*
 
Old 06-18-2009, 02:50 PM   #6
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 603

Original Poster
Rep: Reputation: 39
they all work! thanks guys!
 
Old 06-18-2009, 03:03 PM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Basically even your first command should work: just pay attention to upper/lowercase:
Code:
TLOgs21.090618.10801.REN
ls -lha TLOGs21.090618.?????.REN
 
Old 06-18-2009, 03:28 PM   #8
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 603

Original Poster
Rep: Reputation: 39
WOW!!!! I really need to learn how to pay close attention to details... grrrr :@ I feel so embarrassed!!!! I wish I could delete this threat! LOL
last night I was creating a PYTHON little program but it wasn't giving me the answer it was supposed.. I emailed the code to a friend of mine (Programmer) and he showed me that I was missing a damn ) lol
thanks guys!
 
  


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
SPAM question - General Internet Security question LuggerHouse Linux - Security 1 09-07-2007 08:30 AM
Small question about /etc/rc.local - Symbolic link question Arodef Linux - General 4 05-13-2006 02:29 AM
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM


All times are GMT -5. The time now is 08:24 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