this post was submitted on 20 Feb 2024
-1 points (46.2% liked)
Linux
2439 readers
16 users here now
Shit, just linux.
Use this community for anything related to linux for now, if it gets too huge maybe there will be some sort of meme/gaming/shitpost spinoff. Currently though… go nuts
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
What is wrong with mv *.jpg?
I'm also a bit lost. From the final sentence "having it put each name in quotes should be fucking trivial." OP seems to complain that filenames with spaces expand into multiple arguments. I can't recreate this with this command in bash:
This command prints each argument in its own line. Replace
*.jpg
with whatever to prove it to yourself. Filenames with spaces show in full in a single line for me.It expands
*.jpg
into a list of names.Which you'd think would mean
mv "thing.jpg" "other thing.jpg"
, but no, it doesmv thing.jpg other thing.jpg
- and then chokes, becauseother
is not a valid option or filename. Possibly after writing the contents ofother thing.jpg
onto the destinationthing.jpg
.If any filenames contain characters like
;
or&
, you better hope the next word doesn't look like a command.Which shell are you using? This does not happen in Bash, Zsh, or any modern shell I'm familiar with.
What shell are you using? Is this exclusive to
mv
(and maybe other builtins)?Edit: also why would you ever want to move files like this, what is wrong with you
... like what?
The fuck do you mean, why would I want to move files in a terminal? Because I'm doing shit in a terminal! What, do you expect people to Super+E, find the directory they're in, and drag-and-drop? I'm using tools that only exist in the command line.
I'm using whatever GNOME Terminal came with Linux Mint 20 by default. StackOverflow answers sound like any POSIX terminal will do this. I assume it's standard behavior.
Should be bash. Type
help
it should tell you.Link?
I mean with * where you have no control of the order of the files and you never explicitly say which files are being moved. "yeah, just rename files into other files, I don't fucking care lol" is what your command does