cp 1500+ Files


 
Thread Tools Search this Thread
Operating Systems AIX cp 1500+ Files
# 1  
Old 10-07-2011
cp 1500+ Files

Hello,

I need to copy 1500+ files (total of 170mb) from our /tmp/directory to a different directory /application/program/files

I issue the command:
Code:
user@host[tmp/directory]> cp * /application/program/files

I am getting the follwing error:
Code:
ksh: /usr/bin/cp: arg list too long

being new to aix, I have never seen this error. Can someone point me in the right direction.

Moderator's Comments:
Mod Comment Please use code tags

Last edited by zaxxon; 10-10-2011 at 05:25 AM.. Reason: code tags, see PM
# 2  
Old 10-07-2011
do you check by copying one file ?
# 3  
Old 10-07-2011
Quote:
Originally Posted by polineni
do you check by copying one file ?
Yes, copying one file works.
# 4  
Old 10-07-2011
Did you search this forum before posting your question? You would have found lots of answers to this common problem like this one.
# 5  
Old 10-07-2011
try with
Code:
ulimit -f 100

# 6  
Old 10-07-2011
Quote:
Originally Posted by polineni
try with
Code:
ulimit -f 100

ulimit -f returns unlimited
# 7  
Old 10-07-2011
Quote:
Originally Posted by jeffs42885
I need to copy 1500+ files

user@host[tmp/directory]> cp * /application/program/files

I am getting the follwing error:

ksh: /usr/bin/cp: arg list too long
The reason has nothing to do with AIX and everything with how the shell works: if you enter a "file glob" (like the "*" you used) it is not presented to the program but evaluated by the shell prior to feed its results to the program.

That means: if you enter the command as above and your directory holds only two files, "a" and "b", what the "cp" command would get is:

Code:
cp a b /application/program/files

(in case you wonder: "cp" would get "a" and "b" marked as both being source files).

In your case the list into which the asterisk expands is very, very long. Now, the command line in the shell is limited in length (as far as i remember it is 4k per default). This is why you get the error message.

The solution is to either use the directory name instead of "*" or use another utility: "find" or "tar".

With "find":

Code:
cd /your/source/directory ; find . -type f -exec cp {} /path/to/destination \;

or, with "tar":

Code:
# cd /your/source/dir
# tar -cf - . | (cd /your/destination/dir ; tar -xf - )

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Using larger than 120GB drives on a Blade 1500

Hi, I'm using Solaris 8 on a Blade 1500. I know that IDE drives are limited to around 120GB, but I was told that it's possible to use larger drives with the only caveat that the available size will be that 120 (or is it 128?) GB size. But when I try, format shows only very low sizes, like... (2 Replies)
Discussion started by: BobSol8
2 Replies

2. UNIX Benchmarks

Blade 1500 Silver

CPU/Speed: UltraSPARC-IIIi/1.5Ghz Ram: 1GB Motherboard: Sparc Bus: PCI Cache: Controller: Disk: ATA Load: 1 user Kernel: SunOS 5.10 Generic_137111-02 Kernel ELF?: yes pgms: gcc 2.95.3 compiled BYTE UNIX Benchmarks (Version 3.11) System -- SunOS aachen95 5.10... (0 Replies)
Discussion started by: MadeInGermany
0 Replies

3. Solaris

help installing solaris 10 on sun blade 1500

Hi everyone can someone please explain to me how to install solaris 10 on a sunblade 1500 using cdrom? Thanks for your assistance (1 Reply)
Discussion started by: cjashu
1 Replies

4. Hardware

Nic Card for SunBlade 1500 Tower

Hi, I bought a server Sunblade 1500, and I would like to install a nic card. Anyone know any compatible network card for this server? Regards (1 Reply)
Discussion started by: ph0b0s
1 Replies

5. Solaris

Sun blade 1500 installation and administration problem

Hi I'm completely new in solaris,and don't know many about it. I was installed solaris 10 on sun blade 1500,and also I need to install oracle on it. Now I stuck on some thing and i'm sure that you help me. When i started Oracle installation system told me that I don't have enogh swap space.... (1 Reply)
Discussion started by: dirtyjack
1 Replies

6. Solaris

Sunblade 1500 hba installation

Hi, I have put qlogic hba card and rebooted with -r option to configrue my hba card. How can I verify that it is intalled correctly? I have fiber connection going to storedge T3. Please help. (8 Replies)
Discussion started by: mokkan
8 Replies

7. UNIX for Dummies Questions & Answers

Noob, 1500 static pages to columns

Hi, My name is Mike and I am new here, perhaps the "1 post" gave me away, I have a small problem. I know some very minor UNIX and VI and study hard to get better, this time I took upon myself a task just right above my level, I hope to get two things out of this post 1) some advise to... (3 Replies)
Discussion started by: lawstudent
3 Replies

8. UNIX for Dummies Questions & Answers

Configuring networking interface on Sun Blade 1500

Hi, I am attempting to configure my ethernet interface on a Sun Blade 1500. I am testing out my network interface my connecting a crossover cable from my blade to a windows box. I would like to assign an ip address of 10.0.0.2 to "bge0" and netmask of "255.0.0.0". I have typed the following: ... (1 Reply)
Discussion started by: annointed3
1 Replies

9. UNIX for Advanced & Expert Users

SunBlade 1500 SCSI Floppy Jumpstart

Hello :) I have a customer who is OEMing their own hadware to us. The CPU is right out of a SunBlade 1500. Because of the physical requirements, the keyboard, DVD-ROM drive, 36GB Removable disk drive and scsi floppy are housed in what they call their media box which is in some cases 10 feet from... (0 Replies)
Discussion started by: rambo15
0 Replies

10. Solaris

Moving to Solaris 10 on a SunBlade 1500

I am using a SunBlade 1500 that currently runs Solaris 8 and I would like to install Solaris 10. This workstation has 1Gbyte of memory, 1 GigEthernet card and one 80Gbyte ATA drive. Soon a 2nd 80Gbyte drive will be installed. Are there any 'interesting' points I need to watch for in the... (9 Replies)
Discussion started by: miket
9 Replies
Login or Register to Ask a Question