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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:50:17+00:00 2026-06-11T07:50:17+00:00

I have a folder in my server which contains some files. These are automated

  • 0

I have a folder in my server which contains some files. These are automated that means everyday we get new files automatically which will overwrite the old ones.
So want to take a back up for this data.
How can I copy all these files into another folder by renaming the files with current date while copying.

ex : I have home/webapps/project1/folder1 folder which contains 4 files:

  1. aaa.csv
  2. bbb.csv
  3. ccc.csv
  4. ddd.csv

Now, I want to copy all these four files in to a different location, like home/webapps/project1/folder2.
While copying these files I want to rename each file and add the current date to the file.
So my file names in folder2 should be:

  1. aaa091012.csv
  2. bbb091012.csv
  3. ccc091012.csv
  4. ddd091012.csv

I want to write a shell script for this. Please give me some idea or some sample scripts related to this.

  • 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-11T07:50:19+00:00Added an answer on June 11, 2026 at 7:50 am

    In bash, provided you files names have no spaces:

    cd /home/webapps/project1/folder1
    for f in *.csv
    do 
       cp -v "$f" /home/webapps/project1/folder2/"${f%.csv}"$(date +%m%d%y).csv
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a folder on my remote server that has a few .png files
I have a folder on my web server that has hundreds of mp3 files
I want to copy a folder from server which contains many files but without
I have a static html project which contains some files I want to have
I have a folder which contains a ~50 text files (PHP) and hundreds of
i have created folder on my server (ie finesse)- 'home' in which i have
I have some path c:\server\folderName1\another name\something\another folder\ . How i can extract from there
I am running a website locally. I have one main folder, which contains all
I have a web project in Eclipse that contains a linked folder to another
I'm having trouble with my Apache Web Server. I have a folder (htdocs\images) where

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.