1.

What if the destination file specified in mv command already exists?(a) it will be deleted(b) it will not be affected(c) it will be overwritten(d) an error will be producedThe question was posed to me in class test.This intriguing question comes from Deleting and Renaming files: rm and mv Command in chapter Handling Ordinary Files of Unix

Answer»

The correct option is (c) it will be overwritten

Easy explanation: If the destination file already EXISTS, then the contents of this file will be overwritten with the contents of a source file. For EXAMPLE, mvfile01dir01. If there already exists a file NAMED dir01, then the contents of dir01 will be overwritten with the contents of file01.



Discussion

No Comment Found

Related InterviewSolutions