Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9022213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:27:01+00:00 2026-06-16T05:27:01+00:00

I am working on converting a KornShell (ksh) script to Groovy. I have the

  • 0

I am working on converting a KornShell (ksh) script to Groovy. I have the following Find command – what would be a Groovy way to do something similar, without relying on Unix commands (I need this to work cross-platform, so I can not do a “blah blah”.execute()).

find <source directory> -name <file pattern> -type f -mtime +140 -level 0

This code searches for all files in the source directory (no subdirs) that match a file pattern and are older than 140 days.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:27:02+00:00Added an answer on June 16, 2026 at 5:27 am

    Groovy provides some methods for searching through directories: File.eachFile for the -level 0 case, or File.eachFileRecurse for the general case. Example:

    use(groovy.time.TimeCategory) {
        new File(".").eachFile { file ->
            if (file.isFile() &&
                file.lastModified() < (new Date() - 140.days).time) {
                println file
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on converting a bit of code to SSE, and while I have
I am currently working on converting an application from access to C# and have
Relatively new to working with CR. Have lately been converting a lot of old
I am working on converting a plain tableview to a sectioned tableview. I would
Is there something similar to PHP's SoapClient class for c++? I am working on
i am working on converting CSV to XML, though i have many ways to
I have been working on converting my websites session information over from flatfiles to
I'm working on converting a neural network simulator from Perl to C. I have
I'm working on some stuff related to converting files, and I'm trying to find
Im working on converting and editing images with php wideimage class. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.