The Problem
You entered the command:
rm -rf ~/ .cache/protonvpn
The key mistake is the ~/
space.cache/protonvpn
. In effect you entered:
rm -rf ~/
where the ~
is the shortcut for your home directory /home/crabman
. In other words you entered:
rm -rf /home/crabman/ .cache/protonvpn
The two options you used are r
and f
. From the man page:
-r, -R, --recursive
remove directories and their contents recursively
-f, --force
ignore nonexistent files and arguments, never prompt
The command would also try to delete .cache/protonvpn
. The file/folder .cache/protonvpn
was already deleted by the rm -rf ~/
. Normally you would get an error that the file/folder does not exist. However, the -f
option means the error was ignored.
See this page for some examples of the rm command.
Therefore, you deleted all the files and folders in your home folder.
Two Solutions
1. Restore from backup
Ubuntu comes with a default Backup app. If you use that or any other backup app to make backups to an external or network drive, then you should restore your home folder from the backup.
Note, your home folder contained all your app configuration files that is specific to your username, other than your personal files. The backup app backs up all these hidden configuration folders and files along with your personal files like music and photos.
2. Recover Deleted files
There are various methods to recover deleted files and folders. The easiest of them is to restore from the Trash folder. Unfortunately there are two problems to this approach in your case:
- The Trash folder was also deleted when you deleted your home folder.
- When you use the
rm
command, the files and folders are "permanently" deleted and is not moved to the Trash folder.
You can try other file/folder recovery methods described in:
How to recover deleted files?
Note, as you have been running the computer and trying various things, the internal drives are being used. This means some of the deleted files may not be recoverable as other files (for example, the recovery app you will install) may use the space freed up by your deletion.
Hope this helps
/
and the.
when you enteredrm -rf ~/ .cache/protonvpn
? If you did that was your mistake. – user68186 Jun 03 '22 at 21:42