What will this command do on unix:

rm somefile ~/data

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

link|improve this question

36% accept rate
1  
You deleted the file. – Chuck Jul 28 '09 at 0:03
I don't think it will appear any useful answers out of this awful question. – setatakahashi Jul 28 '09 at 0:18
feedback

migrated from stackoverflow.com Jul 28 '09 at 0:06

This question came from our site for professional and enthusiast programmers.

6 Answers

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.

link|improve this answer
feedback

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
link|improve this answer
Yes, when I do cd ~ I don't see the /data folder anymore! But I do see if it I go to /home/xxxx/users folder. Was it just mirrored or aliased then? How can I get it back? – user3183 Jul 28 '09 at 0:17
feedback

I think you meant to use mv:

mv somefile ~/data

rm means remove.

link|improve this answer
feedback

You removed somefile completely.

rm means 'remove'.

You need 'mv'

Use 'man rm' and 'man mv' for more information.

link|improve this answer
feedback

rm is the remove command. see man rm

link|improve this answer
feedback

Bash/Ubuntu:

meder@meder-desktop:~$ rm lol ~/lmfao
rm: cannot remove `/home/meder/lmfao': Is a directory

As previously stated you want 'mv'

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.