Sponsored Content
Full Discussion: cp 1500+ Files
Operating Systems AIX cp 1500+ Files Post 302562581 by bakunin on Friday 7th of October 2011 10:23:09 AM
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:
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
DH_MOVEFILES(1) 						     Debhelper							   DH_MOVEFILES(1)

NAME
dh_movefiles - move files out of debian/tmp into subpackages SYNOPSIS
dh_movefiles [debhelperoptions] [--sourcedir=dir] [-Xitem] [file...] DESCRIPTION
dh_movefiles is a debhelper program that is responsible for moving files out of debian/tmp or some other directory and into other package build directories. This may be useful if your package has a Makefile that installs everything into debian/tmp, and you need to break that up into subpackages. Note: dh_install is a much better program, and you are recommended to use it instead of dh_movefiles. FILES
debian/package.files Lists the files to be moved into a package, separated by whitespace. The filenames listed should be relative to debian/tmp/. You can also list directory names, and the whole directory will be moved. OPTIONS
--sourcedir=dir Instead of moving files out of debian/tmp (the default), this option makes it move files out of some other directory. Since the entire contents of the sourcedir is moved, specifying something like --sourcedir=/ is very unsafe, so to prevent mistakes, the sourcedir must be a relative filename; it cannot begin with a `/'. -Xitem, --exclude=item Exclude files that contain item anywhere in their filename from being installed. file ... Lists files to move. The filenames listed should be relative to debian/tmp/. You can also list directory names, and the whole directory will be moved. It is an error to list files here unless you use -p, -i, or -a to tell dh_movefiles which subpackage to put them in. NOTES
Note that files are always moved out of debian/tmp by default (even if you have instructed debhelper to use a compatibility level higher than one, which does not otherwise use debian/tmp for anything at all). The idea behind this is that the package that is being built can be told to install into debian/tmp, and then files can be moved by dh_movefiles from that directory. Any files or directories that remain are ignored, and get deleted by dh_clean later. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_MOVEFILES(1)
All times are GMT -4. The time now is 02:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy