Let's say I have a directory called folder_1. Folder_1 has many directories but they all start with 1. Each of these directories has text files, images, etc. I want to move all the content in each of these directories to the parent folder_1.
My assumption is that I have to use something like:
mv -v /folder_1/*1 /folder_1/
But I get the error message that everything is the same file.
1 Answer 1
Try:
mv -v /folder_1/1*/* /folder_1
This would move all files/folders from subfolders starting with 1 into the parent. However, this would omit "hidden" files/folder, whose name starts with a dot ..
To move those as well, try:
find /folder_1/1*/ -mindepth 1 -maxdepth 1 -exec mv -v \{\} /folder_1 \;
-
1The first worked fabulously.munchschair– munchschair2016年10月05日 00:31:31 +00:00Commented Oct 5, 2016 at 0:31
folder1/1*. And you want to exec a mv {} +