what did I do on my linux box, used the rm incorrectly

What will this command do on unix:

rm somefile ~/data

I was trying to move somefile to the folder at home/data


Solution 1:

It will delete ./somefile and, if it's a file, ~/data (assuming you have permission to do so on both of them, of course).

The command you wanted was:

mv somefile ~/data

If you don't do regular backups, you're probably hosed.

Solution 2:

rm means remove...

You wanted mv, which means move

rm somefile ~/data

That command deletes somefile, and also deletes ~/data (data file located in the home directory).

If you wanted to rename/move (the two are the same) somefile to ~/data, the proper command would of been:

mv somefile ~/data