Chapter 11
Moving A File (mv)

11.1 Do This


Source 19: Linux/Mac OSX Exercise 11
  $ cd temp
  $ mv awesome.txt uncool.txt
  $ ls
  newplace uncool.txt
  $ mv newplace oldplace
  $ ls
  oldplace uncool.txt
  $ mv oldplace newplace
  $ ls
  newplace uncool.txt
  $


Source 20: Windows Exercise 11
  > cd temp
  > mv awesome.txt uncool.txt
  > ls
  
  
      Directory: C:\Users\zed\temp
  
  
  Mode                LastWriteTime     Length Name
  ----                -------------     ------ ----
  d----        12/22/2011   4:52 PM            newplace
  d----        12/22/2011   4:52 PM            something
  -a---        12/22/2011   4:49 PM          0 iamcool.txt
  -a---        12/22/2011   4:49 PM          0 neat.txt
  -a---        12/22/2011   4:49 PM          0 thefourthfile.txt
  -a---        12/22/2011   4:49 PM          0 uncool.txt
  
  
  > mv newplace oldplace
  > ls
  
  
      Directory: C:\Users\zed\temp
  
  
  Mode                LastWriteTime     Length Name
  ----                -------------     ------ ----
  d----        12/22/2011   4:52 PM            oldplace
  d----        12/22/2011   4:52 PM            something
  -a---        12/22/2011   4:49 PM          0 iamcool.txt
  -a---        12/22/2011   4:49 PM          0 neat.txt
  -a---        12/22/2011   4:49 PM          0 thefourthfile.txt
  -a---        12/22/2011   4:49 PM          0 uncool.txt
  
  
  > mv oldplace newplace
  > ls newplace
  
  
      Directory: C:\Users\zed\temp\newplace
  
  
  Mode                LastWriteTime     Length Name
  ----                -------------     ------ ----
  -a---        12/22/2011   4:49 PM          0 awesome.txt
  
  
  > ls
  
  
      Directory: C:\Users\zed\temp
  
  
  Mode                LastWriteTime     Length Name
  ----                -------------     ------ ----
  d----        12/22/2011   4:52 PM            newplace
  d----        12/22/2011   4:52 PM            something
  -a---        12/22/2011   4:49 PM          0 iamcool.txt
  -a---        12/22/2011   4:49 PM          0 neat.txt
  -a---        12/22/2011   4:49 PM          0 thefourthfile.txt
  -a---        12/22/2011   4:49 PM          0 uncool.txt
  
  
  >

11.2 You Learned This

Moving files or, rather, renaming them. It's easy: give the old name and the new name.

11.3 Do More

  1. Move a file in the newplace directory to another directory then move it back.


Online Video Course + PDF For $9

For the price of most other course's PDFs only, you can get the full PDF for this class and 2 videos demonstrating the whole book for both Unix/OSX Terminal and Windows PowerShell. The course is self-paced so you can go through it any time you want, as many times as you want.


Signup Now At Udemy.com For $9