Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2156
  • Last Modified:

undo delete files in soloris

how to undo the deleted file in solaris, the command i use is mv


thanks


0
usermic
Asked:
usermic
1 Solution
 
tfewsterCommented:
mv doesn't delete files, it renames them and/or moves them to a different directory. You should be able to reverse the "mv" command and move them back. (Change `mv source target` to `mv target source`)

If the `target` file already existed, it will have been overwritten by the `source` file and you'll need to restore from backup :-(

If you are still having trouble, please post the exact command you used.
0
 
usermicAuthor Commented:
typing error: my command is rm
0
 
tfewsterCommented:
Generally, there's no way to `undo` an rm; If you don't have a backup, there are tools that will help you recover the blocks of data (as long as they haven't been overwritten) but it's a difficult and uncertain process. If it's valuable data, you could get a specialist data recovery company to do it.

See the following thread for further details:
http://www.experts-exchange.com/Operating_Systems/Unix/Q_20267248.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
duyCommented:
unlike windows, you cannot "undo" a command once initiated.
Make certain that you know what you are deleting before doing rm. Good luck!
0
 
jhundpogiCommented:
one good advice always create an alias with your rm with rm -i..; or run a tar/gz before removing anything..

Well mv is also dangerous if used it to move files to /dev/null
0
 
liddlerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by tfewster

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now