- Forums
- Linux Systems
- Work Around - Linux Mv Command Error Argument List Too Long
this is a solution for a command that fails when you send in linux and unix terminal command and it gives you an error that says Argument List Too Long [8873], Last Updated: Sat May 18, 2024
wallpaperama
Wed Dec 31, 1969
0 Comments
222 Visits
so you are trying to move a large number of files and you send a command like this:
mv *.jpg /NewFiles
then you get an error:
-bash: /bin/rm: Argument List Too Longthis is how you solve it. instead you can send this command i use:
cd /home/user1/www/images
mkdir NewFiles
find . -type f -name "*.jpg" | xargs -i mv {} ./NewFiles
ok, let me explain what i did in the last three commands:
1. i changed directory where my jpg file were
2. i created a directory called Newfiles (this is where i wanted to move all the jpg image files)
3. execute the find command and save that list to move it to the NewFiles directory
thats it, hope it works