4 ms·
.js ? FFS, really? find takeout -name ".jpg" -exec mv {} dest_dir
by dmitrygr 4y ago
.js ? FFS, really?
find takeout -name ".jpg" -exec mv {} dest_dir
- anaganisk 4y agoWhat’s wrong with a js script if author is comfortable with it? Is it a rule that everyone must know linux commands?
- dmitrygr 4y ago> What’s wrong with a js script Not much more than is wrong with sending a nuclear-powered aircraft carrier to kill a mosquito > Is it a rule that everyone must know linux commands? Unix, and yes. Every system around you is built on it or something derived from it (either literally or in design).
- anaganisk 4y agoWrong comparison, I’ve taught enough people both UNIX and JS, and there are many of them who consider JS more easier than to grok and use than bash/unix. Not everyone wants to remember all the commands, and most of them use windows. Also, no not every system around me requires me to learn unix, I can use my phone, microwave or even my gaming laptop(windows) without ever opening CLI. Unless Im at work or am I tinkering with my PI4s I don’t even have to touch CLI or even think about a unix command.
- kfrzcode 4y agoYes, rules 8 and 14
- anaganisk 4y agoFrom Unix handbook of how to make people hate the community? C’mon author was good enough to share a script for us to use, he might be just starting in programming, or may be its for a windows use case, don’t have to be so rude like the original commenter which is what I didn’t like.
- kfrzcode 4y agoI'll refer you to rules 0 and 1
- jcutrell 4y agoThere is nothing wrong with it per se, and no, you don’t have to know Linux commands to get by. Sure, a Linux one liner might be “easier” to someone who knows Linux… but that doesn’t mean it’s “wrong.”
- ljahier 4y agoHere the author, I'm not working on windows but macos. I know, the script is not recursive but it's not the goal. The directory architecture of Google takeout > Google photos is one directory per day when there are pictures. In this directory, there are no other directory so the recursive is useless. The goal was to make a script in quick time and I'm comfortable with nodejs that's why I chose it.
- justsomehnguy 4y agols -Recurse -Filter *.jpg | mv dest_dir
- johntash 4y agoOut of everything in this thread, this was the most interesting to me. I didn't know you could pipe a list of files to mv. It makes sense, I guess I just never tried it because anything I would have used it for, I would have used find or xargs instead.
- justsomehnguy 4y agoThis is PowerShell and it doesn't work on *nix machines because ls and mv are native binaries. Would work on Windows, would work on *nix if change it to gci -Recurse -Filter *.jpg | move dest_dir