1

I have a directory, let's call it htdocs/live/. Many different directories are underneath this directory, each with a file commonFunctions.js living in the js directory.

For example, here is the structure of a few of the directories containing commonFunctions.js:

htdocs/live/abc123/js/commonFunctions.js
htdocs/live/program1/js/commonFunctions.js
htdocs/live/program2/js/commonFunctions.js
htdocs/live/bunnies/js/commonFunctions.js
htdocs/live/emerald/js/commonFunctions.js

How can I write a command to list each of these files ordering them by the last time they were modified?

1 Answer 1

2

are you thinking of something like ls -alt htdocs/live/*/js/commonFunctions.js ?

2
  • 1
    I did not know you could use the * in ls like that. This is exactly what I needed.
    – bvpx
    Oct 14, 2013 at 21:11
  • 2
    Incidentally, the * is a function of the shell, not ls. You can use this with any shell command :)
    – MattJenko
    Oct 15, 2013 at 7:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .