drwxrwxr-x 8 root root 4096 Nov 23 15:49 ../
-rwxrwxr-x 1 root root 16240 Nov 23 15:50 1exercise*
-rwxr-xr-x 1 root root 17088 Jan 10 15:46 2exercsie*
-rwxrwxr-x 1 root root 16240 Nov 23 16:06 exercsie2*
-rw-rw-rw- 1 root root 135 Jan 10 15:08 ls06-01.cpp
-rw-rw-rw- 1 root root 1325 Jan 10 15:49 ls06-02.cpp
-rwxr-xr-x 1 root root 16936 Jan 10 15:14 test*
-rwxr-xr-x 1 root root 17088 Jan 10 15:49 test2*
h@h-VirtualBox:~/cxx/6th$ sudo rm ls06-02.cpp
I am using VirtualBox 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
thanks in advance
Once a file has been removed using the rm command (or sudo rm) it is typically considered to be permanently deleted, and there is generally no built-in way to recover the file.
However, there are some third-party tools and methods that can potentially be used to recover a deleted file. The success of these methods depends on a number of factors, such as the file system being used, the method used to delete the file, and the amount of time that has passed since the file was deleted.
Here are a few options to try:
- File recovery software: There are a number of file recovery software programs available that can scan your hard drive and attempt to recover deleted files. Some popular examples include Recuva, EaseUS Data Recovery, and Disk Drill. These programs typically scan the file system to locate deleted files and then try to recover the data.
- Data recovery services: If you are unable to recover the file yourself, you can contact a professional data recovery service. These services specialize in recovering data from damaged or deleted hard drives and other storage devices.
- File backups: If you have a recent backup of the file, you can restore the file from the backup.
It's important to note that if you write new data to the same space where the deleted file resided, it can make it impossible to recover the file or make the recovery process much more complex. So, it is important to stop using the device where the deleted file was until you've recovered the file.
It's always best to have a backup strategy in place to avoid the need of recovering data on the first place.
Hello,
Unless you have backups of your files, or (since I see this is a VirtualBox VM) you have an old snapshot of the VM to roll back to, you won't have any really reliable way to get those files back, no. As ChatGPT's AI-driven reply mentioned there are data recovery services and applications which can sometimes help, but if you don't already have them installed that probably won't be much use to you. Generally speaking, the only way to get back a file that's been deleted is to restore it from the backups that you (hopefully) have.