Score:0

Remove parent folder but keep subfolder intact?

cn flag

Hullo all, i've seen this question asked before but I am hoping for a different solution.

I have this folder structure; /home/radamand/folder1/folder2

folder1 ONLY contains folder2, however folder2 contains about 6 terrabytes of files. Is there a way to remove folder 1, but retain folder2 such that the result would look like this?

/home/radamand/folder2

The previous solution I saw suggested moving all of the files up one dir, then deleting folder2, but this would take quite a while with 6 TB of files, is there another way?

Score:1
mx flag

Move folder2 to wanted new position and remove folder1 (which now must be empty):

mv /home/radamand/folder1/folder2 /home/radamand/folder2
rmdir /home/radamand/folder1/

should do it, I think.

user88710 avatar
cn flag
Okay, but that's still trying to move 6TB of files, which I was hoping to avoid
Soren A avatar
mx flag
That is only moving one directory.entry, not the entire data ... as long as source and destination is within same filesystem.
user88710 avatar
cn flag
Well, I actually tried this and it just started copying files over, one at a time...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.