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
virt-tar-in(1)						      Virtualization Support						    virt-tar-in(1)

NAME
virt-tar-in - Unpack a tarball into a virtual machine disk image. SYNOPSIS
virt-tar-in -a disk.img data.tar /destination virt-tar-in -d domain data.tar /destination zcat data.tar.gz | virt-tar-in -d domain - /destination WARNING
Using "virt-tar-in" on live virtual machines can be dangerous, potentially causing disk corruption. The virtual machine must be shut down before you use this command. DESCRIPTION
"virt-tar-in" unpacks an uncompressed tarball into a virtual machine disk image or named libvirt domain. The first parameter is the tar file. Use "-" to read the tar file from standard input. The second parameter is the absolute target directory to unpack into. EXAMPLES
Upload a home directory to a guest: virt-tar-in -d MyGuest homes.tar /home JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH
This command is just a simple shell script wrapper around the guestfish(1) "tar-in" command. For anything more complex than a trivial copy, you are probably better off using guestfish directly. OPTIONS
Since the shell script just passes options straight to guestfish, read guestfish(1) to see the full list of options. SEE ALSO
guestfish(1), virt-cat(1), virt-copy-in(1), virt-copy-out(1), virt-edit(1), virt-make-fs(1), virt-tar-out(1), <http://libguestfs.org/>. AUTHORS
Richard W.M. Jones ("rjones at redhat dot com") COPYRIGHT
Copyright (C) 2011 Red Hat Inc. <http://libguestfs.org/> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. libguestfs-1.18.1 2013-12-07 virt-tar-in(1)
All times are GMT -4. The time now is 09:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy