1.

If we create a file using cat command with the same filename which already exists in the current directory then,(a) existing file is deleted(b) new file will be created separately(c) existing file will be overwritten(d) an error will be producedI had been asked this question in an online interview.This key question is from Displaying and Creating Files: cat Command in division Handling Ordinary Files of Unix

Answer»

Right choice is (c) EXISTING file will be overwritten

For EXPLANATION I WOULD say: As cat command is ALSO used to create files, so if we want to create a file with the same filename which already exists in the DIRECTORY then the existing file will be overwritten.



Discussion

No Comment Found

Related InterviewSolutions