How to Move a File from One Directory to Another in Linux?
Contents Moving Files with Mv. to Move a File or Directory from One Location to Another, Use the Command Mv. Common Useful Options for Mv Include: -I...
Contents
Moving files with mv.
To move a file or directory from one location to another, use the command mv.
Common useful options for mv include: -i (interactive) — Prompts you if the file you have selected overwrites an existing file in the destination directory.
How do you move a file to another directory in Linux?
mv command is used to move files and directories.
- mv command syntax. $ mv [options] source dest.
- mv command options. mv command main options: option. description.
- mv command examples. Move main.c def.h files to /home/usr/rapid/ directory: $ mv main.c def.h /home/usr/rapid/
- See also. cd command. cp command.
Must Read
How do I move a file from one directory to another in Unix?
To move a file into a directory using the mv command pass the name of the file and then the directory. In the following example the file foo.txt is moved into the directory bar .