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.

-5

u/spiralings Aug 27 '15

Not a mistake. Is confusing.

Moving out of a file into a new one essentially deletes old and adds new

7

u/[deleted] Aug 27 '15

There is a typo if you look carefully