Score:0

Accidentally deleted everything in home directory along with other important files

jp flag

Might be the worst mistake I've made in Ubuntu. To give some context: I created a directory named "~" by accident in the home directory. Didn't want it so I recursively deleted the directory. Next thing I know is that all my files in the home directory are gone, and I can't used commands such as gcc and apt. Is there a way I can recover from this, or should I just take the L and move on? Also might be good to note that I don't have sudo permissions.

in flag
No backups, I assume?
zwets avatar
us flag
Or a recent install with Ubuntu on ZFS?
KGIII avatar
in flag
I'm in the 'take the L and move on' camp. If there's any data you can back up, go for it. If not, this is a very important lesson you learned, and you didn't even have to pay for a tutor! (The lesson being twofold - be careful when deleting stuff and have *working* backups.)
Score:0
cn flag

You did not state, but it looks like you recursively deleted ~ using a terminal command (e.g. rm -r ~). ~ expands to the absolute path of your home directory. What should have done what you wanted is:

rm -r '~'

Note the single quotes '. These tell the command interpreter, bash, not to try expanding the enclosed characters, so this would have removed a dile or directory named ~ in the current directory. Using an absolute path, the command would have been

rm -r ~/'~'

This explicitly refers to ~ in the home directory.

Directories and files are, indeed, effectively deleted. Recovering is not at all trivial where possible. So unfortunately, yes, these data are essentially lost, so it is hoped you have a good backup.

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.