I have a folder, we'll call it /scripts/
, that contains subfolders for a number of different scripts (let's say /scripts/file_export
, /scripts/record_ingest
, /scripts/stats
). Inside these folders are all kinds of things...shell scripts, perl scripts, ruby scripts, config files, etc. Some have their own directory structure, some have everything in their root. I saw this question and thought I could run that command inside a for loop, but I'm wondering if there's a more efficient way to write this using find and piping without just iterating over each folder in a loop. Ideas?
-
Don't make us chase links: please add the relevant info to this question.– glenn jackmanOct 1, 2014 at 13:52
Add a comment
|
1 Answer
I'm not sure exactly what you want, but the following meets what you seem to be asking:
find . -exec ls -db --full-time {} \; | sed -e 's/^[^ ]* [^ ]* [^ ]* [^ ]* [^ ]* //' -e 's/ [+-][0-9][0-9][0-9][0-9]//' | sort
Any other directory could of course be used in the find
, for example find /scripts/
.
-
1