Article 5869K Finding the pattern to ls

Finding the pattern to ls

by
czezz
from LinuxQuestions.org on (#5869K)
Im trying to find a pattern that allows me to list current log file and its latest rotated one.
So, what I want as an input is eg.
Code:/var/log/syslog
/var/log/syslog.1
...and skip all remaining 2,3,4,5 and so on.I was hoping that following would work but it doesnt
Code:ls -al /var/log/syslog*[,1]
-rw-r----- 1 syslog adm 268915 Sep 16 08:06 /var/log/syslog.1Any quick ideas here?latest?d=yIl2AUoC8zA latest?i=8w3KK4INJGQ:N1lD6ZmqiDU:F7zBnMy latest?i=8w3KK4INJGQ:N1lD6ZmqiDU:V_sGLiP latest?d=qj6IDK7rITs latest?i=8w3KK4INJGQ:N1lD6ZmqiDU:gIN9vFw8w3KK4INJGQ
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments