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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:00:31+00:00 2026-05-21T06:00:31+00:00

I got a directory which contains approx 9000 files, the file names are in

  • 0

I got a directory which contains approx 9000 files, the file names are in ascending number (however not necessarily consecutive).

Now I need to copy/move ~3000 files from number xxxx to number yyyy to another direcotory. How can I use cp or mv command for that purpose?

  • 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-21T06:00:32+00:00Added an answer on May 21, 2026 at 6:00 am

    You can use the seq utility to generate numbers for this kind of operation:

    for i in `seq 4073 7843` ; do cp file_${i}_name.png /destination/folder ; done
    

    On the downside, this will execute cp a lot more often than QuantumMechanic’s solution; but QuantumMechanic’s solution may not execute if the total length of all the filenames is greater than the kernel’s argv size limitation (which could be between 128K and 2048K, depending upon your kernel version and stack-size rlimits; see execve(2) for details).

    If the range you want spans orders of magnitudes (e.g., between 900 and 1010) then the seq -w option may be useful, it zero-pads the output numbers.

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

Sidebar

Related Questions

I've got a user control which contains a number of other user controls. I
I have an update site, and got the directory which contains the features and
I've got a project in which I have a directory for each aspect of
I've got a repository which contains most of my application settings. I'd like to
I have developed iPhone app which contains a 80MB audio files and 20MB images
On the root of my webservice application, I have a directory which contains some
I've got a directory location, how can I create all the directories? e.g. C:\Match\Upload
Greetings, I've got a directory with a list of pdfs in it: file1.pdf, file2.pdf,
Follow up to this question about GNU make : I've got a directory, flac
I've got a site with some administrative pages in its root directory. Question: Is

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.