Sample Header Ad - 728x90

/usr/bin/truncate: Argument list too long

2 votes
2 answers
787 views
I want to use the truncate command to create a huge number of small files for testing. I tried the command with a small number of files (100) and it worked. When I changed the number to 1000000, it reports an error: root:[~/data]# truncate -s 1k {1..100} root:[~/data]# rm -rf * root:[~/data]# truncate -s 1k {1..1000000} -bash: /usr/bin/truncate: Argument list too long root:[~/data]# How can I solve it? I have a sense that xargs could be used, but I can't make it work.
Asked by Just a learner (2022 rep)
Aug 25, 2019, 07:14 PM
Last activity: Aug 26, 2019, 02:19 PM