Hi SilverCookieDust,
SilverCookie wrote:I want to strip out the many subfolders for now. Later I'll go through the files to delete duplicates that are exact copies as well as any other unnecessary files, and then I'll redistribute to subfolders that are better named and organised than the current ones. I named the folder Archive because it's a collection of documents that I keep stored but rarely use (I'm an obsessive compulsive hoarder).
I would make a backup of these original folders and files before running any re-organizing (copying or moving) commands so that if something did not work as you expected, you do not lose anything.
SilverCookie wrote:Thanks for the tip, but can I ask what's the advantage to having it under the Documents or Home folder?
The main advantage would be organizational, documents like text files under documents. You could still have a Desktop shortcut launcher "link" to the "archive" folder if you wanted that.
SilverCookie wrote:Also, you linked to some questions about Ubuntu; I was a bit uncertain when searching myself, but does that mean any (or most) commands that work on Ubuntu also work on Mint? I could never quite figure out the difference in the types of Linux and I mostly settled on Mint because I love anything mint-flavoured. (Uh... not that I'm trying to eat my PC or anything. Promise
)
Most references to Ubuntu will work with Linux Mint which their main versions are based on as long as the versions match. Linux Mint 19.x is based on Ubuntu 18.04, Linux Mint 18.x is based on Ubuntu 16.04, etc... There can be some differences with commands between the versions, especially with security-related commands. I do not think the copy or moving commands will matter though with non-root folders.
I just ran this command below to copy any music mp3 file in my home Music folder and its subfolders to an "archive" folder in my home folder and it worked perfectly. The tilda "
~" represents the "/home/YourUserName/". Replace "cp" for copy with "mv" to move them. Also, uppercase and lowercase characters matter in Linux.
FYI: click "select all" above a code box to highlight the command, then right-click it to copy it (or Ctl+Insert, or Ctl+C), then you can paste that command using right-click paste or Shift+Insert or Ctl+Shift+V.
Code: Select all
find ~/Music -type f -iname "*.mp3" -exec cp --backup=numbered -t ~/archive {} +
So, using your original statements, this command below should work to move all ".txt" files from all subfolders in the "/Desktop/Archive" folder to its top parent folder "/Desktop/Archive", and it may take some time on that many files. Obviously, you can change the source and destination folder path locations. You will still have a bunch of empty folders (directories) to delete afterward, yet if you created a new empty Archive folder elsewhere like "/Documents/Archive" and moved all the txt files to that folder, you could easily delete the original (source) folder and all of its now empty subfolders.
Code: Select all
find ~/Desktop/Archive -type f -iname "*.txt" -exec mv --backup=numbered -t ~/Desktop/Archive {} +
or use this command to move all the txt files to a new Archive folder underneath the Documents folder, create the new folder first.
Code: Select all
find ~/Desktop/Archive -type f -iname "*.txt" -exec mv --backup=numbered -t ~/Documents/Archive {} +
Hope this helps ...