Comment on mv *.jpg is complete bullshit.
mindbleach@sh.itjust.works 8 months agols | grep | mv
would work, except the StackOverflow discussion also highlights how parsing ls can have the same issues.
I am moving thousands of files at once. If I have to check each one, it’s still wrong.
The pragmatic answer turns out to be ./*
instead of *
.
FigMcLargeHuge@sh.itjust.works 8 months ago
I saw that answer and was just offering another option. I am sure xargs might work, but you would need to test as you need a destination passed on each line. Back to my way, I have used it for a lot more than just the move command. I think I used it to do a chmod once where I wanted to check and make sure before I committed to actually running the command(s). You could also use find and the -exec option, which I think was also mentioned here.