r/linux • • Aug 27 '15

Learn the Command Line from codeacademy

https://www.codecademy.com/en/courses/learn-the-command-line?utm_campaign=lcl_release&utm_source=reddit
305 Upvotes

59 comments sorted by

View all comments

16

u/EVOIXMR Aug 27 '15

mv batman.txt spiderman.txt

To rename a file, use mv with the old file as the first argument and the new file as the second argument. By moving batman.txt into spiderman.txt, we rename the file as superman.txt.

Is this a mistake? I'm not quite sure what superman.txt has anything to do with "mv batman.txt spiderman.txt"

Being new to Unix this confused me quite a bit.

1

u/takegaki Aug 28 '15

Ah new to unix I see. It categorizes the destination file name and randomly draws things from the category. So it sees you're dealing with superheroes and randomly drew superman to be used as the new filename. This decreases the chance for a file to get overwritten due to user error.