cp'ing a large amount of files

cp'ing a large amount of files

Post by Rob Alla » Fri, 28 Feb 1997 04:00:00



While doing some cleanup, we tried to move a bunch of log files from the
logging dir to a dir with the year in its name. (I.E. all of the log
files from 1996 to a dir call logs_1996.)

Under csh, when we tried a "mv *", we got an error message saying there
were too many files. Is there a way around this? Is there another shell
I could wrap around the command to get this to work?

--

Ontario Hydro                   |  Tel. (416) 592 4195

 
 
 

cp'ing a large amount of files

Post by Fletcher.Gl.. » Sat, 01 Mar 1997 04:00:00



>While doing some cleanup, we tried to move a bunch of log files from the
>logging dir to a dir with the year in its name. (I.E. all of the log
>files from 1996 to a dir call logs_1996.)

>Under csh, when we tried a "mv *", we got an error message saying there
>were too many files. Is there a way around this? Is there another shell
>I could wrap around the command to get this to work?

>--

>Ontario Hydro                   |  Tel. (416) 592 4195

Try the following:

mv [a-o]* destination
mv [p-z]* destination

If this still gets the too many files message, try splitting the file
names even more.



 
 
 

cp'ing a large amount of files

Post by Sean S Coleman 303-497-567 » Sat, 01 Mar 1997 04:00:00



> While doing some cleanup, we tried to move a bunch of log files from the
> logging dir to a dir with the year in its name. (I.E. all of the log
> files from 1996 to a dir call logs_1996.)

> Under csh, when we tried a "mv *", we got an error message saying there
> were too many files. Is there a way around this? Is there another shell
> I could wrap around the command to get this to work?

> --

> Ontario Hydro                   |  Tel. (416) 592 4195

I would try mmv. It allows you to do multi-file moves and
change the name on multiple files.

Sean Coleman
NIST

 
 
 

cp'ing a large amount of files

Post by Ed Rav » Mon, 03 Mar 1997 04:00:00




>> Under csh, when we tried a "mv *", we got an error message saying there
>> were too many files. Is there a way around this? Is there another shell
>> I could wrap around the command to get this to work?
>I would try mmv. It allows you to do multi-file moves and
>change the name on multiple files.

I would try xargs, it's the "UNIX way" of solving a problem like this.
--
Ed Ravin        |If I were not a little mad and generally silly

                |I should show you in a moment how to grapple with the question
                |And you'd really be astonished at the force of my suggestion.
 
 
 

cp'ing a large amount of files

Post by O'Shaughnessy Eva » Thu, 06 Mar 1997 04:00:00





>>While doing some cleanup, we tried to move a bunch of log files from the
>>logging dir to a dir with the year in its name. (I.E. all of the log
>>files from 1996 to a dir call logs_1996.)

>>Under csh, when we tried a "mv *", we got an error message saying there
>>were too many files. Is there a way around this? Is there another shell
>>I could wrap around the command to get this to work?

>>--

>>Ontario Hydro                   |  Tel. (416) 592 4195

>Try the following:

>mv [a-o]* destination
>mv [p-z]* destination

>If this still gets the too many files message, try splitting the file
>names even more.



   With both of these solutions, you can run into the problem of having too
   many parameters in the argument list.  Here's a solution that should
   work:

      tar cf - source_path | (cd dest_dir; tar xfvp -)

   This way you can't overload the command line.  Plus, you maintain
   permissions and ownership attributes across the copy.

--
--
O'Shaughnessy Evans
UNIX/Internet Systems Administrator, GST-Call America; SLO, CA

 
 
 

cp'ing a large amount of files

Post by Kjetil Torgrim Homm » Fri, 07 Mar 1997 04:00:00


[Rob Allan]

|   Under csh, when we tried a "mv *", we got an error message saying
|   there were too many files. Is there a way around this? Is there
|   another shell I could wrap around the command to get this to work?

[Ed Ravin]

|   I would try xargs, it's the "UNIX way" of solving a problem like
|   this.

You'll need to write a wrapper script, since xargs will always put the
extra static args at the beginning.

#! /bin/sh -
dest="$1"; shift;

Kjetil T.

 
 
 

cp'ing a large amount of files

Post by Rob McMah » Sun, 23 Mar 1997 04:00:00



Quote:> |   Under csh, when we tried a "mv *", we got an error message saying there
> |   were too many files. Is there a way around this? Is there another shell
> |   I could wrap around the command to get this to work?

> [Ed Ravin]

> |   I would try xargs, it's the "UNIX way" of solving a problem like this.

> You'll need to write a wrapper script, since xargs will always put the extra
> static args at the beginning.

You can always do

ls | xargs -i{} mv {} $dest

Rob
--
UUCP:   ...!mcsun!uknet!warwick!cudcv   PHONE:  +44 1203 523037

Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England

 
 
 

1. cp'ing files from Dos/Windows partition to Linux partition

On Mon, 26 Jun 2000 00:59:05 GMT, Bruceh

No, this is not normal.  Check your /etc/fstab and make sure that no
"conv=" strings are present in the line that specifies mount options for
the DOS partition.  It should look like so:

/dev/hda1   /mnt/dos   noexec,user,noauto   0   0

By default, no conversion is performed on DOS files, but you can get CRLF
-> LF translation on text files by specifying "conv=auto" in the fstab
options.  Which distro is this, btw?  Seems like a silly thing for them to
be doing....

--
Matt G / Dances With Crows      /\    "Man could not stare too long at the face
\----[this space for rent]-----/  \   of the Computer or her children and still
 \There is no Darkness in Eternity \  remain as Man." --David Zindell "So did
But only Light too dim for us to see\ they become Gods, or Usenetters?" --/me

2. **The BEST Secret XXX Password***

3. Error while cp'ing files from mounted Novell volumes

4. SCSI Disk Install

5. cp'ing xx.gz files breaks crc integrity

6. Solaris 8 hostname problem

7. vi'ing very large files`

8. Dell DXII/66 works with Linux?

9. vi'ing large files

10. mmap'ing a large file

11. ftp'ing large files problem

12. X probs after cp'ing

13. Sequencing large amounts of files.