I have various folders each containing files as such:/.example1/example1.txt/.example1/example2.txt/.example2/example1.txt/.example2/example2.txtetc.And want to find a way to move each of the files into a subfolder of its parent folder, eg:/.example1/folder/example1.txt/.example1/folder/example2.txt/.example2/folder/example1.txt/.example2/folder/example2.txtetc.Any ideas on a quick and simple way to do this for large amounts of files? I've already tried playing around with find but without much luck.
Move files from various subfolders into sub-subfolders
shell;files;directory
You can do it using GNU versions of find and mv like this:find . -mindepth 2 -maxdepth 2 -type f -execdir mv -vt ./folder/. {} +Where we constrain find to look for regular files 2 levels deep and then using the -execdir option to move the selected file(s) into the subdirectory folder which is co-adjacent to the selected file(s).