5.J: Removing Files | 5: Moving Files and Directories | 5.H: Moving Files |
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.
5.J: Removing Files | 5: Moving Files and Directories | 5.H: Moving Files |