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 7159467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:14:10+00:00 2026-05-28T13:14:10+00:00

Tricky question for a bash noob like me, but i’m sure this this easier

  • 0

Tricky question for a bash noob like me, but i’m sure this this easier that it seems to me.
I’m currently using the find command as follows :

run "find #{current_release}/migration/ -name '*.sql'| sort -n | xargs  cat >#{current_release}/#{stamp}.sql"

in my capistrano recipe.

Problem is #{current_release}/migration/ contains subfolders, and I’d like the find command to include only one of these, depending on it’s name (that I know, it’s based on the target environment.

As a recap, folder structure is

Folder
|- sub1
|- sub2

and i’m trying to make a find specifying to recurse ONLY on sub1 for example. I’m sure this is possible, just couldn’t find how.
Thanks.

  • 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-05-28T13:14:11+00:00Added an answer on May 28, 2026 at 1:14 pm

    Simply specify the directory you want as argument to find, e.g. find #{current_release}/migration/sub1 ....

    EDIT: As per your clarification, you should use the -maxdepth argument for find, to limit the recursion depth. So, for example, you can use find firstdir firstdir/sub1 -maxdepth 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a slightly tricky question. I am using NSDateFormatter on the iPhone but
i find this question tricky but what files store method signature info for xml
I find this question a little tricky. Maybe someone knows an approach to answer
This sounds like a tricky question... let me ellaborate... I have a treeView. When
I know this is basic but I find it tricky and couldn't quite phrase
I read that this is a tricky question because an applet is run in
I know its a bit of a tricky question but like the information about
I am studying for an exam and came across this question that seems a
This is a bit tricky question for you computer scientists. Let's say that I
This is a tricky question to ask. A friend of mine seeks help, and

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.