# Getting Past Bash Argument list too long

DevFeed: [Getting Past Bash Argument list too long](<https://devfeed.tech/articles/getting-past-bash-argument-list-too-long-28128.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/bash/2020/06/25/getting-past-bash-argument-list-too-long.html>)

Author: Fuzzygroup

Published: 2020-06-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Bash](<https://devfeed.tech/topics/bash.md>), [Scripting, bash](<https://devfeed.tech/topics/scripting-bash.md>), [Unix](<https://devfeed.tech/topics/unix.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [files](<https://devfeed.tech/tags/files.md>), [linux](<https://devfeed.tech/tags/linux.md>), [root](<https://devfeed.tech/tags/root.md>), [ubuntu](<https://devfeed.tech/tags/ubuntu.md>), [unix](<https://devfeed.tech/tags/unix.md>)

## AI overview

A Bash article explains how to handle operations on a directory containing about 750,000 files without exceeding the shell's argument-list limit. It shows that using the current-directory operand for chown avoids wildcard expansion and uses find with -exec to move JSON files individually.

## Source excerpt

Right now I have a directory with about 750,000 odd files in it and any attempt to manipulate the files results in this: root@ip-172-31-1-219:~/datastreamer/data# mv * /home/ubuntu/data/data bash: /bin/mv: Argument list too long My first challenge was to do this: chown ubuntu:ubuntu * And the fix for this one was actually easy: chown ubuntu:ubuntu . By omitting the *, the bash limits on argument list don't apply - this changes the current folder (.) and everything in it and it always works. The second challenge was to move the files from /root/datastreamer/data to /home/ubuntu/data/data. Here's the solution after a bit of research: find /root/datastreamer/data -name '*.json' -exec mv {} /home/ubuntu/data/data \; Reference: Unix.StackExchange StackOverflow