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

  • Home
  • SEARCH
  • 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 3796910
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:18:58+00:00 2026-05-19T13:18:58+00:00

I have a directory with several *.js files. Quantity and file names are unknown.

  • 0

I have a directory with several *.js files. Quantity and file names are unknown. Something like this:

js/
 |- 1.js
 |- 2.js
 |- blabla.js

I need to merge all the files in this directory into one merged_dmYHis.js. For example, if files contents are:

1.js

aaa
bbb

2.js

ccc
ddd
eee

blabla.js

fff

The merged_280120111257.js would contain:

aaa
bbb
ccc
ddd
eee
fff

Is there a way to do it using bash, or such task requires higher level programming language, like python or similar?

  • 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-19T13:18:59+00:00Added an answer on May 19, 2026 at 1:18 pm
    cat 1.js 2.js blabla.js > merged_280120111257.js
    

    general solution would be:

    cat *.js > merged_`date +%d%m%Y%H%M`.js
    

    Just out of interest – do you think it is a good idea to name the files with DDMMYYYYHHMM? It may be difficult to sort the files chronologically (within the shell). How about the YYYYMMDDHHMM pattern?

    cat *.js > merged_`date +%Y%m%d%H%M`.js
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a directory that contains several files. I want compress this folder to
I have a directory with several subdirectories with files. How can I copy all
I have a directory which contains several files, many of which has non-english name.
I have a directory and in it has several files. I'm trying to decrypt
I have several files with name abc* and i want to delete all those
I am trying to merge several data.frames into one data.frame . Since I have
I have several files with code testing code (which uses a unittest class). Later
I have edited several files ISO-8859-15 encoded php source files with netbeans 6.7.1, but
I have an InstallScript installer that utilizes dynamic file links for several components. These
I need some help. Right now i have done a file search that will

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.