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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:02:42+00:00 2026-06-03T13:02:42+00:00

The question is maybe trivial but I can’t get it to work. I just

  • 0

The question is maybe trivial but I can’t get it to work. I just want to merge 2 particular files present in multiple specific folders into a new single file again in each specific folder.

cat */folder_*/*/file.a */folder_*/*/file.b > */folder_*/*/file.c

but it does not work ’cause

-bash: */folder_*/*/file.c: No such file or directory

So I thought maybe for some reason cat can’t create files (though it does), so I tried

touch */folder_*/*/file.c; cat */folder_*/*/file.a */folder_*/*/file.b > */folder_*/*/file.c

but again it does not work with cat or even touch.

  • 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-03T13:02:43+00:00Added an answer on June 3, 2026 at 1:02 pm
    for dir in */folder_*/*; do 
      [[ -d "$dir" ]] && ( cd "$dir" && cat file.a file.b > file.c )
    done
    

    I run the cd && cat in a subshell so you don’t have to cd back to where you started.

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

Sidebar

Related Questions

This may be a trivial question, but I will ask it anyway: can updates
This question maybe a better fit on The Business of Software forum but despite
my question is maybe a dumb one, but i cant help myself - i
Maybe the question sound not good or too simple. But not for me in
Maybe the question is familiar but I need an explanation in this case. Let's
Maybe this question has been asked many times before, but I never found a
Maybe my question it's a little weird, but I'm trying to build a not-so-simple
Maybe this question is kind of silly but I have no clue how to
Sorry for the maybe trivial question. I fought a bit with the unix join
May be it's a silly (or more than trivial) kinda question, but it seems

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.