3.3 Renaming Files
Suppose you created a text file called statstics.txt
After creating and saving this file you realize you misspelled the filename! You want to
correct the mistake, which of the following commands could you use to do so?
cp statstics.txt statistics.txt
mv statstics.txt statistics.txt
mv statstics.txt .
cp statstics.txt .
Solution
1. No. While this would create a file with the correct name, the incorrectly named file still exists in the directory
and would need to be deleted.
2. Yes
3. No, the period(.) indicates where to move the file, but does not provide a new file name; identical file names
cannot be created.
4. No, the period(.) indicates where to copy the file, but does not provide a new file name; identical file names
cannot be created.
Episode 3 Exercise 4