CompTIA Linux+ (XK0-005) — Question 255
A Linux administrator is tasked with moving files in a database server. The administrator must not overwrite any existing files. Which of the following commands would indicate that the file already exists?
Answer options
- A. mv –i filename /tmp/backup
- B. mv –b filename /tmp/backup
- C. mv –n filename /tmp/backup
- D. mv –f filename /tmp/backup
Correct answer: A
Explanation
The correct command is 'mv –i', which prompts the user if the destination file exists, thus preventing overwriting. The 'mv –b' option creates a backup of the existing file but does not prompt; 'mv –n' will not overwrite files but doesn't indicate their existence. 'mv –f' forcibly moves the file and will overwrite without any warning.