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?


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?