Sunday, 11 January 2015

Copy/Move file in linux

You can copy/move file in linux using cp/mv command.

To copy file:
Syntax:
  • cp [options] <source file> <destination file>
  • cp [options] <source path of file> <destination path of file>
Examples:
  • cp file1 file2
  • cp /tmp/file1 /data/file2


To move file:
Syntax:
  • mv [options] <source file> <destination file>
  • mv [options] <source path of file> <destination path of file>
Examples:
  • mv file1 file2
  • mv /tmp/file1 /data/file2


Note: You can also use mv command to rename file

No comments:

Post a Comment