Linked Questions
23 questions linked to/from What defines the maximum size for a command single argument?
14
votes
4
answers
21k
views
How to cause "Argument list too long" error? [duplicate]
Context for the question: According to POSIX specs, ARG_MAX is maximum length of command-line arguments to exec() family of functions. Which lead me to believe that's actual number of arguments, ...
1
vote
1
answer
12k
views
How many files can rm delete at once? [duplicate]
One of my friends wanted to have more logs in the /var/log/ directory, and after some time of using the system, he tried to access the folder and list it, but instead he got the following error:
bash:...
-1
votes
1
answer
518
views
xargs: The command line for command is built up until it reaches a system-defined limit - What limit? [duplicate]
I looked briefly at the source code of xargs in findutils 4.6.0 and saw that
'n' defines: args_per_exec
But there seems to be no default value for args_per_exec in find utils
So where is the 'system-...
1
vote
0
answers
43
views
How much arguments can I pass to command? [duplicate]
Is there any limit of arguments that could be passed to C/C++, Python, Bash etc. program? Practical usage: pass bitmap data from/to C++ to/from Python program via arguments.
29
votes
6
answers
17k
views
cat a very large number of files together in correct order
I have about 15,000 files that are named file_1.pdb, file_2.pdb, etc. I can cat about a few thousand of these in order by doing:
cat file_{1..2000}.pdb >> file_all.pdb
However, if I do this for ...
11
votes
2
answers
30k
views
CP: max source files number arguments for copy utility
Consider that there are countless number of files under /src/
cp /src/* /dst/
How many files cp will successfully process?
17
votes
3
answers
6k
views
Difference between {1,2,3} and {1..3}
Is there a difference between the sequences {1,2,3} and {1..3}?
For example if I have some files
file.1
file.2
file.3
and I want to cat them together is it safe to use cat file.{1..3} > file?
...
20
votes
2
answers
7k
views
Is there a maximum to bash file name expansion (globbing) and if so, what is it?
Is there a maximum to bash file name expansion (globbing) and if so, what is it?
See globbing on tldp.org.
Let's say I want to run a command against a subset of files:
grep -e bar foo*
rm -f bar*
Is ...
5
votes
1
answer
4k
views
Argument list too long
I'm trying to enter a command with VERY big argument (1 MB in size), but it says "Argument list too long." How can I enter that argument?
OS: Linux Ubuntu
3
votes
4
answers
6k
views
Find and move with exclude
I need to use find and mv together
requirement : Need to find all file *.xml but exclude deposit.xml and move it to another folder ( fairly simple)
My attempt :
mv `find ./*.xml '!' -type d | ...
5
votes
1
answer
4k
views
Setting a long environment variable breaks a lot of commands
I've been seeing a strange behavior when messing up with the environment variables. I'm setting up a very long environment variable and this prevent launching any command:
( Ubuntu 14.04.5 LTS (GNU/...
2
votes
1
answer
5k
views
Storing longer text output in memory in shell variables vs Writing to disk
I have the below call to db2 database command line tool inside a loop, which runs 100k iterations.
(the output from db2 is 5 rows of 20 chars approx per each call, total of approx 100k calls. The ...
4
votes
3
answers
3k
views
How do I delete files with the same names in multiple sub-folders from the command line?
I have a folder called simulations, which contains 101 subfolders. These sub-folders are named posterior_predictive_sim_1 to posterior_predictive_sim_101.
Each subfolder contains five files: seq.nex, ...
3
votes
4
answers
2k
views
Generating unique IDs for json content indexing
I am looking for effective and simple ID generation for the following content using bash script:
{"name": "John", "surname": "Gates", "country": "Germany", "age": "20", "height": "180"}
{"name": "...
2
votes
1
answer
4k
views
Display file using Dialog
I have a file on disk which contains some text I want to display on the screen. You can do it like this:
dialog --yesno "`cat FILE`" 10 100
However, I'm concerned that if FILE becomes large, I'm ...