Moving large number of files

find /source/directory -mindepth 1 -maxdepth 1 -name '*' -print0 | xargs -0 mv -t /target/directory;
if you want to move with command mv large list of files than you would get following error /bin/mv: Argument list too long alternavite with exec: find /source/directory -mindepth 1 -maxdepth 1 -name '*' -exec mv {} /target/directory \;
Sample Output

By: aysadk
2020-11-17 12:30:45

What Others Think

use xargs instead of -exec
nordri · 4 weeks and 5 days ago
@nordri command updated, thank you.
aysadk · 4 weeks and 5 days ago
a hit freelancers swear by exercises — washing your face, putting on real garments and placing smartphone boundaries — and those recommendations increase to ingesting. dietary therapist and longtime paintings-from-homer wilma macdonald told huffpost that snacking right here and there's the largest mistake she sees new far flung workers make. she recommends setting up your day like all everyday working day, with a lunch wreck, a few smaller breaks and a focus at the most important meal: breakfast.
webcontentonline · 4 weeks and 5 days ago [url=][/url]
webcontentonline · 4 weeks and 5 days ago
System error code 200 means "The code segment cannot be greater than or equal to 64K." This error code may also display as "ERROR_RING2SEG_MUST_BE_MOVABLE" or as the value 0xC8.
brandonisaac · 4 weeks and 3 days ago
Do you know the methods for moving large number of files in a simple way? If you don’t know the steps then this website details will be helpful for that. Anyway thank you so much for providing this programming language for us bmw auto repair shops
leonamargret · 4 weeks ago
thanks for this man. exactly what i needed.
looneyhans · 3 weeks and 6 days ago
thanks for this nice article!
Killersmile · 3 weeks and 3 days ago
Your website is very good. Your article has aroused a lot of positive attention. Read more for more info.
keywave110 · 2 weeks and 4 days ago
Thanks for sharing such a great article with us.Thanks a lot
sara · 1 week and 5 days ago
Have this problem pretty often when I can't move files. I guess doesn't really matter when I can use my usb stick but no o convenient lately. I'm using resume writing service and sometimes my resume takes lots of storage so I need to find an alternative
ira34 · 6 days ago
love this kitchen remodel
looneyhans · 6 days ago
learned alot here dothan fence company
looneyhans · 5 days ago
Will this work for an rs gold site?
charlesmax23 · 3 days ago
Thanks for sharing,It's useful for me
jojokoko · 3 days ago [url=][/url]
jojokoko · 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: