2

I am new to Linux & was running some random commands to experiment in terminal (Ubuntu-18.04 LTS) & by mistake I deleted my home directory.

The command I executed is shown in the screenshot of my history below. It was

rm -r /home/dawn

Now all my files are gone, as well as the default folders such as Pictures, Desktop, Screenshots, etc & my desktop screen has turned dark black.

When I tried to open the files icon, it's giving me an error.

Can anyone help me on this?

command history

unable to find the requested file

Zanna
  • 72,312

2 Answers2

0
  • If you lost some important data try to recover with 'testdisc'.

  • If no important data is lost and you can boot. Go to settings>Details>Users unlock and add another user with Administrative powers, set password and login again or reboot. Login as new user from there you can delete the previous user.

I wonder why you did it.

Vijay
  • 8,556
0

If your account was new (without any important/personal files) just re-create your home:

  1. Log out current user from GUI.
  2. Switch to text console by pressing eg. Ctrl+Alt+F1.
  3. Copy fresh user base files and change its ownership:

    sudo cp -r /etc/skel $HOME
    sudo chown `id -u`.`id -g` $HOME
    

    Or:

    sudo mkhomedir_helper $USER
    
  4. Log user again to GUI, your additional dirs will be recreated (Desktop, Pictures etc. - according to /etc/xdg/user-dirs*).

madneon
  • 2,063
  • 1
  • 14
  • 20