I accidentally deleted a file by running:
rm -rf ./Desktop/myScript.sh
I think it's possible to recover the file, because the
rm command removes temporarily. How can I recover the deleted file on Mac OSX?
MacOS is a Unix OS and
Strictly speaking (as @ire_and_curses points out) a
The MacOS also has a secure remove command (
[ I should hasten to add that even if you over-write a disk multiple times, there are ways to read what was written a dozen or more times before. To properly sanitize a disk for disposal really requires an acid bath, a big hammer and a shredder. ]
Opening a file and immediately
In Unix and Linux (of which the MacOS is a branded Unix), an
Depending on your content, but you can use different 3rd party softwares to do that, e.g.:
and many more.
You can find more apps by typing 'data recovery' in App Store.
More advanced way is to boot your OSX in recovery mode (or umount your partition if you can) and look for it manually (if you remember some specific text from your script).
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?