- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Trying to move (mv) large numbers of files
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2001 01:31 PM
тАО09-21-2001 01:31 PM
If my wildcard returns too many files, I get:
'arg list too long'
As in:
# mv ap* ..
ksh: /usr/bin/mv: arg list too long
This is probably a stupid question, but is there a parameter I can set to extend this 'arg list'
Thanks, Erik
Solved! Go to Solution.
- Tags:
- Arg list too long
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2001 01:48 PM
тАО09-21-2001 01:48 PM
Re: Trying to move (mv) large numbers of files
when you do
# mv ap* ..
are you actully using the .. at the end?
if you man on mv you can see it says:
mv cannot be used to perform the following operations:
+ Rename either the current working directory or its parent
directory using the . or .. notation.
+ Rename a directory to a new name identical to the name of a
file contained in the same parent directory.
try the full pathname instead of ..
richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2001 01:56 PM
тАО09-21-2001 01:56 PM
Solutionfind . -type f -print | xargs -i mv {} wherever
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2001 01:56 PM
тАО09-21-2001 01:56 PM
Re: Trying to move (mv) large numbers of files
Example of simple rm:
# rm ap*
ksh: /usr/bin/rm: arg list too long
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2001 01:57 PM
тАО09-21-2001 01:57 PM
Re: Trying to move (mv) large numbers of files
for i in `find . -name ap\*`
do
mv $i ..
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2001 02:05 PM
тАО09-21-2001 02:05 PM
Re: Trying to move (mv) large numbers of files
I still have the problem if I want to be selective, having to use a wildcard with text.
example 'rm ap*'
The find command gave the same error:
'arg list too long'
I'm on 10.20
Thanks, again
Erik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2001 02:10 PM
тАО09-21-2001 02:10 PM
Re: Trying to move (mv) large numbers of files
lets try this .. I found this doc here does this help?
SYS ADM: Error when moving large group of files - arg list is too long.
Current Path Home
Score : 0
Document Type : EN
Date : 1998 Aug 16
Description : SYS ADM: Error when moving large group of files - arg list is too long.
Document Id : A5218911
Search String :
You may provide feedback on this document
View the printer friendly version of this document
--------------------------------------------------------------------------------
Problem Description
I am trying to move a group of files that are specified with
a wildcard. I am getting this error:
arg list is too long.
Why am I getting this message?
Configuration Info
Operating System - HP-UX
Version - 10.20
Hardware System - HP9000
Series - D350
Solution
The file names are about 45 characters, and you are trying to
move about 550 files.
500 files * (45 char / file) = 24750 characters
The ARG_MAX value is 20480.
Solve the problem by installing this patch:
PHKL_15457
The above patch has these dependencies:
PHCO_14842
PHCO_14990
PHNE_14770
PHKL_12340
Note: Patches can be superseded by subsequent versions;
be sure to load the current version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2001 05:54 PM
тАО09-23-2001 05:54 PM
Re: Trying to move (mv) large numbers of files
rm ap*
does not pass the * character to rm! The shell sees the special * character and translates it to match the list of files so the rm program sees:
rm ap1 ap2 ap333 ap343 ap5 ap6 ... and so on
So if you have 5 million files and the average length of each file name is 10 characters, the the command line passed to rm must hold 55 million bytes. So the only way to process an unlimited number of arguments is to use xargs or find.
If you use find, remember that the shell will try to expand the * so it must be escaped as in:
find /some_directory -name ap\* -exec ll {} \;
In the above example, -exec ll will verify that the right filenames will be selected. Then replace ll with /usr/bin/rm. Do not use rm without /usr/bin just to make sure what command you are using.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2001 04:17 AM
тАО09-24-2001 04:17 AM
Re: Trying to move (mv) large numbers of files
START ------------------
/*
* The following limits are not actually invariant, but are configurable.
* The correct values can be determined using the sysconf() function.
* The default values are provided here because the constants are specified
* by several publications including XPG (X/Open Portability Guide) Issue 2
* and SVID (System V Interface Definition) Issue 2.
*/
# define ARG_MAX 20478 /* Maximum length of arguments for the
exec function in bytes, including
environment data */
END-----------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2001 06:14 AM
тАО09-24-2001 06:14 AM
Re: Trying to move (mv) large numbers of files
I will probably always run into this problem, as Bill has stated, there will always be a limit...
The escaped wildcard in the find or xargs will be my solution.
Thank, for this great forum.
God Bless America.
Erik