You probably wouldn't do that in Python because Python isn't a shell. It was never designed to write mini programs in 5 seconds as a way to interact with the computer.
You would write a script with os.listdir and 'if "old" in path' if you wanted to automate it.
If you were doing things interactively in a python minded OS, you might either have something much like shell is today(Maybe very stripped down without a focus on programming features beyond glob, expansion, and pipes), or you would have python library of misc utils.
Maybe you would do
x=ls()
search(x, "old")
But that would be rather slow. Maybe you'd have some completely new model of text based interaction that was more menu driven and looked a lot like VS Code's command palette.
You'd press tab at the beginning of a line(Arbitrary easy to reach shortcut), and get your command pallet. Start typing and fuzzy search happens.
Select "Search filenames", and maybe that's a common enough snippet that it would be built in. Now you have that whole script, and your cursor is already in the search term field.
Press tab there. You get a menu of recently set variables, recently used short strings, etc, that the heuristic might want you to have.
With better UI we could afford a more explicit traditional language syntax.
Both scripting and shell could be a lot better.