How can I recover my files and my system after running rm -r /home/username? [duplicate]
up vote
1
down vote
favorite
This question already has an answer here:
How to recover deleted files?
11 answers
Can files/directories deleted with rm be restored?
7 answers
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-line data-recovery home-directory
New contributor
marked as duplicate by user535733, karel, Melebius, muru
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
1
down vote
favorite
This question already has an answer here:
How to recover deleted files?
11 answers
Can files/directories deleted with rm be restored?
7 answers
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-line data-recovery home-directory
New contributor
marked as duplicate by user535733, karel, Melebius, muru
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Have you check your trash folder so you should be able to access it fromthe terminal using the commands in the following link: askubuntu.com/questions/327943/…
– Graham
Nov 20 at 15:05
try this one !!
– abu-ahmed al-khatiri
Nov 20 at 15:22
1
follow the steps outlined here askubuntu.com/a/150673/18025 essentially reboot your machine using the same install medium you used to install ubuntu ( memory stick or DVD) then issue outlined commands
– Scott Stensland
Nov 20 at 15:26
1
@Graham if OP deleted $HOME how will they be able to access~/.local/share/Trash
from the linked post? Also OP, I am curious why you wouldrm -r $HOME
? I would suggest using a vm if you are going to experiment with dangerous commands like what you did. That being said there is this cgsecurity.org/wiki/TestDisk
– j-money
Nov 20 at 17:08
Understood........
– Krishnendu Dawn
2 days ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
This question already has an answer here:
How to recover deleted files?
11 answers
Can files/directories deleted with rm be restored?
7 answers
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-line data-recovery home-directory
New contributor
This question already has an answer here:
How to recover deleted files?
11 answers
Can files/directories deleted with rm be restored?
7 answers
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?
This question already has an answer here:
How to recover deleted files?
11 answers
Can files/directories deleted with rm be restored?
7 answers
command-line data-recovery home-directory
command-line data-recovery home-directory
New contributor
New contributor
edited 2 days ago
Zanna
49k13123234
49k13123234
New contributor
asked Nov 20 at 14:29
Krishnendu Dawn
61
61
New contributor
New contributor
marked as duplicate by user535733, karel, Melebius, muru
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by user535733, karel, Melebius, muru
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
Have you check your trash folder so you should be able to access it fromthe terminal using the commands in the following link: askubuntu.com/questions/327943/…
– Graham
Nov 20 at 15:05
try this one !!
– abu-ahmed al-khatiri
Nov 20 at 15:22
1
follow the steps outlined here askubuntu.com/a/150673/18025 essentially reboot your machine using the same install medium you used to install ubuntu ( memory stick or DVD) then issue outlined commands
– Scott Stensland
Nov 20 at 15:26
1
@Graham if OP deleted $HOME how will they be able to access~/.local/share/Trash
from the linked post? Also OP, I am curious why you wouldrm -r $HOME
? I would suggest using a vm if you are going to experiment with dangerous commands like what you did. That being said there is this cgsecurity.org/wiki/TestDisk
– j-money
Nov 20 at 17:08
Understood........
– Krishnendu Dawn
2 days ago
add a comment |
1
Have you check your trash folder so you should be able to access it fromthe terminal using the commands in the following link: askubuntu.com/questions/327943/…
– Graham
Nov 20 at 15:05
try this one !!
– abu-ahmed al-khatiri
Nov 20 at 15:22
1
follow the steps outlined here askubuntu.com/a/150673/18025 essentially reboot your machine using the same install medium you used to install ubuntu ( memory stick or DVD) then issue outlined commands
– Scott Stensland
Nov 20 at 15:26
1
@Graham if OP deleted $HOME how will they be able to access~/.local/share/Trash
from the linked post? Also OP, I am curious why you wouldrm -r $HOME
? I would suggest using a vm if you are going to experiment with dangerous commands like what you did. That being said there is this cgsecurity.org/wiki/TestDisk
– j-money
Nov 20 at 17:08
Understood........
– Krishnendu Dawn
2 days ago
1
1
Have you check your trash folder so you should be able to access it fromthe terminal using the commands in the following link: askubuntu.com/questions/327943/…
– Graham
Nov 20 at 15:05
Have you check your trash folder so you should be able to access it fromthe terminal using the commands in the following link: askubuntu.com/questions/327943/…
– Graham
Nov 20 at 15:05
try this one !!
– abu-ahmed al-khatiri
Nov 20 at 15:22
try this one !!
– abu-ahmed al-khatiri
Nov 20 at 15:22
1
1
follow the steps outlined here askubuntu.com/a/150673/18025 essentially reboot your machine using the same install medium you used to install ubuntu ( memory stick or DVD) then issue outlined commands
– Scott Stensland
Nov 20 at 15:26
follow the steps outlined here askubuntu.com/a/150673/18025 essentially reboot your machine using the same install medium you used to install ubuntu ( memory stick or DVD) then issue outlined commands
– Scott Stensland
Nov 20 at 15:26
1
1
@Graham if OP deleted $HOME how will they be able to access
~/.local/share/Trash
from the linked post? Also OP, I am curious why you would rm -r $HOME
? I would suggest using a vm if you are going to experiment with dangerous commands like what you did. That being said there is this cgsecurity.org/wiki/TestDisk– j-money
Nov 20 at 17:08
@Graham if OP deleted $HOME how will they be able to access
~/.local/share/Trash
from the linked post? Also OP, I am curious why you would rm -r $HOME
? I would suggest using a vm if you are going to experiment with dangerous commands like what you did. That being said there is this cgsecurity.org/wiki/TestDisk– j-money
Nov 20 at 17:08
Understood........
– Krishnendu Dawn
2 days ago
Understood........
– Krishnendu Dawn
2 days ago
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
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.
1
how will that recover the files?
– Graham
Nov 20 at 15:13
It was an experiment
– Krishnendu Dawn
2 days ago
add a comment |
up vote
0
down vote
If your account was new (without any important/personal files) just re-create your home:
- Log out current user from GUI.
- Switch to text console by pressing eg. Ctrl+Alt+F1.
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
Log user again to GUI, your additional dirs will be recreated (
Desktop
,Pictures
etc. - according to/etc/xdg/user-dirs*
).
@Zanna there is no $HOME/, it was deleted...
– madneon
2 days ago
You are right haha so just that command should do it I think
– Zanna
2 days ago
Thanks, this is already done.
– Krishnendu Dawn
2 days ago
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
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.
1
how will that recover the files?
– Graham
Nov 20 at 15:13
It was an experiment
– Krishnendu Dawn
2 days ago
add a comment |
up vote
0
down vote
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.
1
how will that recover the files?
– Graham
Nov 20 at 15:13
It was an experiment
– Krishnendu Dawn
2 days ago
add a comment |
up vote
0
down vote
up vote
0
down vote
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.
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.
edited 2 days ago
answered Nov 20 at 15:10
Hobbyist
989617
989617
1
how will that recover the files?
– Graham
Nov 20 at 15:13
It was an experiment
– Krishnendu Dawn
2 days ago
add a comment |
1
how will that recover the files?
– Graham
Nov 20 at 15:13
It was an experiment
– Krishnendu Dawn
2 days ago
1
1
how will that recover the files?
– Graham
Nov 20 at 15:13
how will that recover the files?
– Graham
Nov 20 at 15:13
It was an experiment
– Krishnendu Dawn
2 days ago
It was an experiment
– Krishnendu Dawn
2 days ago
add a comment |
up vote
0
down vote
If your account was new (without any important/personal files) just re-create your home:
- Log out current user from GUI.
- Switch to text console by pressing eg. Ctrl+Alt+F1.
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
Log user again to GUI, your additional dirs will be recreated (
Desktop
,Pictures
etc. - according to/etc/xdg/user-dirs*
).
@Zanna there is no $HOME/, it was deleted...
– madneon
2 days ago
You are right haha so just that command should do it I think
– Zanna
2 days ago
Thanks, this is already done.
– Krishnendu Dawn
2 days ago
add a comment |
up vote
0
down vote
If your account was new (without any important/personal files) just re-create your home:
- Log out current user from GUI.
- Switch to text console by pressing eg. Ctrl+Alt+F1.
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
Log user again to GUI, your additional dirs will be recreated (
Desktop
,Pictures
etc. - according to/etc/xdg/user-dirs*
).
@Zanna there is no $HOME/, it was deleted...
– madneon
2 days ago
You are right haha so just that command should do it I think
– Zanna
2 days ago
Thanks, this is already done.
– Krishnendu Dawn
2 days ago
add a comment |
up vote
0
down vote
up vote
0
down vote
If your account was new (without any important/personal files) just re-create your home:
- Log out current user from GUI.
- Switch to text console by pressing eg. Ctrl+Alt+F1.
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
Log user again to GUI, your additional dirs will be recreated (
Desktop
,Pictures
etc. - according to/etc/xdg/user-dirs*
).
If your account was new (without any important/personal files) just re-create your home:
- Log out current user from GUI.
- Switch to text console by pressing eg. Ctrl+Alt+F1.
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
Log user again to GUI, your additional dirs will be recreated (
Desktop
,Pictures
etc. - according to/etc/xdg/user-dirs*
).
edited yesterday
answered 2 days ago
madneon
1,4181620
1,4181620
@Zanna there is no $HOME/, it was deleted...
– madneon
2 days ago
You are right haha so just that command should do it I think
– Zanna
2 days ago
Thanks, this is already done.
– Krishnendu Dawn
2 days ago
add a comment |
@Zanna there is no $HOME/, it was deleted...
– madneon
2 days ago
You are right haha so just that command should do it I think
– Zanna
2 days ago
Thanks, this is already done.
– Krishnendu Dawn
2 days ago
@Zanna there is no $HOME/, it was deleted...
– madneon
2 days ago
@Zanna there is no $HOME/, it was deleted...
– madneon
2 days ago
You are right haha so just that command should do it I think
– Zanna
2 days ago
You are right haha so just that command should do it I think
– Zanna
2 days ago
Thanks, this is already done.
– Krishnendu Dawn
2 days ago
Thanks, this is already done.
– Krishnendu Dawn
2 days ago
add a comment |
1
Have you check your trash folder so you should be able to access it fromthe terminal using the commands in the following link: askubuntu.com/questions/327943/…
– Graham
Nov 20 at 15:05
try this one !!
– abu-ahmed al-khatiri
Nov 20 at 15:22
1
follow the steps outlined here askubuntu.com/a/150673/18025 essentially reboot your machine using the same install medium you used to install ubuntu ( memory stick or DVD) then issue outlined commands
– Scott Stensland
Nov 20 at 15:26
1
@Graham if OP deleted $HOME how will they be able to access
~/.local/share/Trash
from the linked post? Also OP, I am curious why you wouldrm -r $HOME
? I would suggest using a vm if you are going to experiment with dangerous commands like what you did. That being said there is this cgsecurity.org/wiki/TestDisk– j-money
Nov 20 at 17:08
Understood........
– Krishnendu Dawn
2 days ago