OSU Computational Physics - Landau Research Group (nacse) -
Next 5.J: Removing Files  Up 5: Moving Files and Directories  Prev 5.H: Moving Files  Contents

Basic

§ 5.I:  Moving Directories Around


If you wish to "move" all of the files from directory into another directory (regardless of whether the latter directory has already been created or not), use the mv command exactly as you do for files. Again, mv works just like the copy command. Yet since subdirectories are always moved, there is no recursive -r option. For example, here we rename of the /development/prog/backup directory to development/prog/bu:

> cd ~/development/prog
> mv -i backup bu
> ls *

Here we did a "list" afterwards as a check, and got the response:

a.out area.f
bu:
area.f

Once again, you can use wildcards to save yourself some typing. In that case, you should issue the list command before your move to be safe.


Next 5.J: Removing Files  Up 5: Moving Files and Directories  Prev 5.H: Moving Files  Contents