Saturday, October 13, 2012

How to rename a file in linux

using mv(move) you can rename files/directory

If i want to rename file1 as file2

$mv file1 file2 

 another way to rename file names

$cp file1 file2 (it will copy file1 content to file2)
now you can remove file1
$rm file1
 

cp: omitting directory Error

When you try to copy files you may get error :  cp: omitting directory Error

To avoid this error you may enter command as  cp -r   source_file Destination_file