Which option is used with rm command to make the command prompt the user with each filename and a ?, before acting on it

  1. -r

  2. -x

  3. -i

  4. -1


Correct Option: C
Explanation:

The answer is C, -i.

The -i option tells the rm command to prompt the user before deleting each file. This is useful if you want to make sure you are deleting the correct files.

The other options are not correct.

  • -r recursively deletes directories and their contents.
  • -x forces the rm command to continue even if it encounters errors.
  • -1 prompts the user once before deleting more than three files.

Here is an example of how to use the -i option:

rm -i file1 file2 file3

This will prompt the user to confirm the deletion of each file. For example, the user might be prompted with the following:

rm: remove file1? (y/N)

If the user enters y, the file will be deleted. If the user enters N, the file will not be deleted.

Find more quizzes: