I'd like to search a directory listing for all files that either start with JL or NL, and only return those results.
I know I can do a ls -lrt JL* or an ls -lrt NL* but I need to know how to combine those in one statement.
How about ls -lrt JL* NL*
?
The pattern is expanded by the shell, so it tastes exactly the same to ls
.
If you're using bash
you could also ls -lrt [JN]L*
to create a single pattern that does what you want.