LinuxQuestions.org
Visit Jeremy's Blog.
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-28-2017, 02:56 AM   #1
massy
Member
 
Registered: Nov 2013
Distribution: CentOS 6.4
Posts: 209
Blog Entries: 1

Rep: Reputation: Disabled
Getting wrong output of ls command with wildcards


I've use this command to get some files thay their date is between 10-29 but I get irrelevant items.
ls /var/log/auth.log.[10-29]*
Output is included items like as this:
.../auth.log.1.gz

.../auth.log.2.gz
 
Old 11-28-2017, 03:02 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,783

Rep: Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574
No ...
You are getting correct output. Your misunderstanding doesn't make the output wrong.
 
Old 11-28-2017, 03:06 AM   #3
massy
Member
 
Registered: Nov 2013
Distribution: CentOS 6.4
Posts: 209

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
I want list just files that are between 10-29 not 1,2,...
 
Old 11-28-2017, 03:17 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,676
Blog Entries: 3

Rep: Reputation: 2908Reputation: 2908Reputation: 2908Reputation: 2908Reputation: 2908Reputation: 2908Reputation: 2908Reputation: 2908Reputation: 2908Reputation: 2908Reputation: 2908
See "man 7 glob" for the details but what you would be looking for is this:

Code:
ls auth.log.[12][0-9].gz
 
  


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
Giving wrong output with sh but correct output with command entry in Ubuntu bison72 Linux - Newbie 3 10-14-2015 11:27 PM
linux wildcards LS command need help deidei112 Linux - Newbie 13 01-08-2015 04:34 AM
[SOLVED] Using wildcards in a sed command Lokelo Linux - Newbie 17 11-23-2011 08:25 PM
How to output a string by using wildcards? fish-master Linux - Newbie 3 02-21-2010 03:03 PM
ls command line, color and wildcards ioio85 Linux - Newbie 1 05-13-2004 05:01 AM

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

All times are GMT -5. The time now is 07:09 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
Open Source Consulting | Domain Registration