Sponsored Content
Top Forums Shell Programming and Scripting Unexpected Argument list too long error on later os level Post 302989027 by say170 on Friday 6th of January 2017 11:10:29 AM
Old 01-06-2017
The old box has:
Code:
xargs --show-limits
Your environment variables take up 1231 bytes
POSIX lower and upper limits on argument length: 2048, 129024
Maximum length of command we could actually use: 127793
Size of command buffer we are actually using: 127793

The new box has:
Code:
Your environment variables take up 2078 bytes
POSIX upper limit on argument length (this system): 2617314
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2615236
Size of command buffer we are actually using: 131072

The base command isn't any bigger, and the target folder is smaller, so I don't get why it doesn't work if Maximum length of command is what it seems to imply.

I've updated my script to use
Code:
-exec sudo mv -f {}

which works (much slower), but I would be interested for opinions on why the other way didn't work - it may be a redhat bug.

Last edited by say170; 01-06-2017 at 01:01 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Argument list too long - Shell error

Trying to tar specific files from a directory causes problems when the number of files is too large. ls ~/logs | wc -l 5928 In the logs directory - I have 5928 files If I want to include all files with today's date - I run the following command tar cf ~/archive/LoadLogs_20060302.tar... (8 Replies)
Discussion started by: dad5119
8 Replies

2. Shell Programming and Scripting

TAR Files Argument list too long error

Hi, I have a requirement where I need to TAR more than 50K files. Even though I can do TAR successfully on few 100s of files, but whenever Im trying to TAR the entire 50K files, I am getting the error message : Argument List Too Long. Please suggest how can i avoid this error. Im... (2 Replies)
Discussion started by: unx100
2 Replies

3. Shell Programming and Scripting

"Argument list too long" error

Hi everyone, I have a problem with my shell script. As a quick overview I need to change a template file 6561 times and copy the file into a new catalogue. Thanks to your forum I have managed to write a script to do so: #!/bin/sh template=$1 for values in {45,165,285}\ {45,165,285}\... (6 Replies)
Discussion started by: mario8eren
6 Replies

4. Shell Programming and Scripting

Argument too long list error

I have a wrote a script which consits of the below line.. Below of this script I'm getting this error "ksh: /usr/bin/ls: arg list too long" The line is log_file_time=`ssh -i $HOME/.ssh/id_rsa -q $i ls -lrt /bp/karthik/test/data/log/$abc*|tail -1|awk '{print $8}'` And $abc alias is as "p |... (1 Reply)
Discussion started by: 22karthikreddy
1 Replies

5. Shell Programming and Scripting

Argument list too long problem

I have a huge set of files (with extension .common) in my directory around 2 million. When I run this script on my Linux with BASH, I get /bin/awk: Argument list too long awk -F'\t' ' NR == FNR { a=NR } NR != FNR { sub(".common", "", FILENAME) print a, FILENAME, $1 } '... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Shell Programming and Scripting

Argument list too long!!

Dear Experts, I have a list of 10K files in a directory. I am not able to execute any commands lile ls -lrt, awk, sed, mv, etc........ I wanna execute below command and get the output. How can I achieve it?? Pls help. root# awk -F'|' '$1 == 1' file_20120710* | wc -l /bin/awk: Argument list... (2 Replies)
Discussion started by: Naga06
2 Replies

7. Shell Programming and Scripting

grep : Argument list too long

Hi, i am having some trouble with the below command, can some one suggest me the better way to do it. grep -l 'ReturnCode=1' `find $Log -newer /tmp/Failed.tmp -print | xargs ls -ld | egrep SUB | egrep -ve 'MTP' -ve 'ABC' -ve 'DEF' -ve 'JKL' -ve 'XYZ' | awk '{print $9}'` > $Home1 Its... (2 Replies)
Discussion started by: Prateek007
2 Replies

8. Shell Programming and Scripting

mv : Argument list too long

Hi I am using find command -- find "directory1" -type f | xargs -i mv {} "directory2" to avoid above argument list too long problem. But, issue i am facing is directory1 is having subdirectories due to this i am facing directory traversal problem as i dont want to traverse subdirectories... (9 Replies)
Discussion started by: VSom007
9 Replies

9. UNIX for Advanced & Expert Users

Argument list too long w/ sed

Hi all, I am using GNU sed (named gsed under macports) in OSX. I have a directory with a series of files named pool_01.jpg through pool_78802.jpg. I am trying to use this command to rename the files to their checksum + extension. md5sum * | gsed -e 's/\(*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/e' ... (3 Replies)
Discussion started by: openthomas
3 Replies

10. Shell Programming and Scripting

Argument list too long

Hi Team, Here's the situation. I have approximately 300000 to 500000 jpg files in /appl/abcd/work_dir mv /appl/abcd/work_dir /appl/abcd/process_dir The above move command will work if the jpg files count is close to 50000 (not sure). If the count is less this mv command holds good. But if... (14 Replies)
Discussion started by: kmanivan82
14 Replies
PRLIMIT(1)							   User Commands							PRLIMIT(1)

NAME
prlimit - get and set process resource limits SYNOPSIS
prlimit [options] [--resource[=limits] [--pid PID] prlimit [options] [--resource[=limits] command [argument...] DESCRIPTION
Given a process ID and one or more resources, prlimit tries to retrieve and/or modify the limits. When command is given, prlimit will run this command with the given arguments. The limits parameter is composed of a soft and a hard value, separated by a colon (:), in order to modify the existing values. If no lim- its are given, prlimit will display the current values. If one of the values is not given, then the existing one will be used. To specify the unlimited or infinity limit (RLIM_INFINITY), the -1 or 'unlimited' string can be passed. Because of the nature of limits, the soft limit must be lower or equal to the high limit (also called the ceiling). To see all available resource limits, refer to the RESOURCE OPTIONS section. soft:hard Specify both limits. soft: Specify only the soft limit. :hard Specify only the hard limit. value Specify both limits to the same value. GENERAL OPTIONS
-h, --help Display help text and exit. --noheadings Do not print a header line. -o, --output list Define the output columns to use. If no output arrangement is specified, then a default set is used. Use --help to get a list of all supported columns. -p, --pid Specify the process id; if none is given, the running process will be used. --raw Use the raw output format. --verbose Verbose mode. -V, --version Display version information and exit. RESOURCE OPTIONS
-c, --core[=limits] Maximum size of a core file. -d, --data[=limits] Maximum data size. -e, --nice[=limits] Maximum nice priority allowed to raise. -f, --fsize[=limits] Maximum file size. -i, --sigpending[=limits] Maximum number of pending signals. -l, --memlock[=limits] Maximum locked-in-memory address space. -m, --rss[=limits] Maximum Resident Set Size (RSS). -n, --nofile[=limits] Maximum number of open files. -q, --msgqueue[=limits] Maximum number of bytes in POSIX message queues. -r, --rtprio[=limits] Maximum real-time priority. -s, --stack[=limits] Maximum size of the stack. -t, --cpu[=limits] CPU time, in seconds. -u, --nproc[=limits] Maximum number of processes. -v, --as[=limits] Address space limit. -x, --locks[=limits] Maximum number of file locks held. -y, --rttime[=limits] Timeout for real-time tasks. EXAMPLES
prlimit --pid 13134 Display limit values for all current resources. prlimit --pid 13134 --rss --nofile=1024:4095 Display the limits of the RSS, and set the soft and hard limits for the number of open files to 1024 and 4095, respectively. prlimit --pid 13134 --nproc=512: Modify only the soft limit for the number of processes. prlimit --pid $$ --nproc=unlimited Set for the current process both the soft and ceiling values for the number of processes to unlimited. prlimit --cpu=10 sort -u hugefile Set both the soft and hard CPU time limit to ten seconds and run 'sort'. SEE ALSO
ulimit(1), prlimit(2) NOTES
The prlimit system call is supported since Linux 2.6.36, older kernels will break this program. AUTHORS
Davidlohr Bueso <dave@gnu.org> - In memory of Dennis M. Ritchie. AVAILABILITY
The prlimit command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/. util-linux July 2014 PRLIMIT(1)
All times are GMT -4. The time now is 07:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy