Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What will this command do on unix:

rm somefile ~/data

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

share|improve this question

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

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

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

6 Answers 6

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.

share|improve this answer

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
share|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

I think you meant to use mv:

mv somefile ~/data

rm means remove.

share|improve this answer

You removed somefile completely.

rm means 'remove'.

You need 'mv'

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

share|improve this answer

rm is the remove command. see man rm

share|improve this answer

Bash/Ubuntu:

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

As previously stated you want 'mv'

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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