I tried the method here, but it failed.
I have test files and folders in
~/Desktop/z named n copy, n copy 2, and untitled folder.
I cd'd to z, ran the command, then this was the output:
How can this be done?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
The script is fine and works perfectly when I tested it. The output is telling you that the folder that you’re trying to create already exists (probably from a first round of testing and then neglecting to delete the folder before running another test).
However, the files still get moved into the correct folders. So either make sure the folders don’t already exist, or just ignore the message.
Don’t forget, your script is designed to move files, not folders. So untitled folder (presuming it’s a folder) will be ignored. n copy and n copy 2 (if these are files, not folders) get moved into folders of the same name.