0

I have managed to create a bizarre problem in my file system and I don't know how to recover. In my home directory I had a Dropbox folder and I decided to change the scope of the Dropbox folder to include my complete home folder as well as any home folders for other users on this system. Before starting this procedure I closed Dropbox.

The Dropbox folder contained directories that had been symlinked from the home directory as well as normal directories. I then started to move directories out from the Dropbox folder to the home directory. I successfully moved all but one folder. The last folder was truly bizarre. It had a file name of "~" only and was created about two months ago so I have no idea what managed to create it. If I do an ls on it I get the contents of the home directory. I have thus created a loop in the file system since since the Dropbox folder is a sub-folder of the home folder and the dropbox folder effectively contains the home folder as a sub-folder, meaning that I am unable to remove the Dropbox folder from the home folder as it is not empty.

What I would like to do remove the directory entry for the "~" folder from the Dropbox folder, using the command line, without removing the directory contents which are actually the contents of the home folder but I have no idea how to do this.

Jonathan
  • 1,280
  • The answers in the potential duplicate assume that there will be no damage to the home folder by attempting to remove the "~" folder but if I can list the contents of the home folder while positioned in the Dropbox folder, how can I get rid of the contents of the "~" without trashing the home folder and possibly the complete system in the process? – Jonathan Apr 16 '16 at 21:20
  • 3
    Always take a backup before starting something you're not sure of, but there it a huge difference between ~ and \~. ;-) – Fabby Apr 16 '16 at 21:24
  • The "~" folder was created two months ago so it is in all my backups and another one immediately prior to starting this procedure would not have helped. – Jonathan Apr 16 '16 at 21:34
  • Sorry for not being clear: before you start rm \~... – Fabby Apr 16 '16 at 22:36
  • Is it a symlink or something? –  Apr 18 '16 at 11:43
  • If it is a symlink, it'll show up as ~ -> /home/USERNAME in ls -a in the dir containing the dupe ~. Just do rm -r '~' (mind the single quotes) –  Apr 18 '16 at 11:57

0 Answers0