Link to home
Start Free TrialLog in
Avatar of usermic
usermic

asked on

undo delete files in soloris

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


thanks


Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of usermic
usermic

ASKER

typing error: my command is rm
ASKER CERTIFIED SOLUTION
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
unlike windows, you cannot "undo" a command once initiated.
Make certain that you know what you are deleting before doing rm. Good luck!
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
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