Skip to content
GK24
Computer AwarenessMediumAsked in: RRB NTPC · 06 Jun, 2025, Shift 2

Consider a hierarchical file system. If a user attempts to delete a non-empty directory using a standard 'delete directory' command without any recursive options, what is the most likely outcome?

  1. A.The operating system will automatically delete all files and subdirectories within it.
  2. B.Only the directory structure will be removed, leaving the files and subdirectories orphaned.
  3. C.The operating system will prompt the user for confirmation to delete each item within the directory.
  4. D.The operating system will return an error indicating that the directory is not empty

Correct answer

D. The operating system will return an error indicating that the directory is not empty

Explanation

The correct answer is D, the operating system will return an error indicating that the directory is not empty. The plain remove-directory command is built to delete an empty folder only. In Windows it is rmdir, also written rd, and in Linux it is rmdir; both stop with a message such as "The directory is not empty" when anything is still inside. To remove a folder along with everything in it you have to ask for it: rmdir /s in Windows or rm -r in Linux, which walks through the tree, deletes the contents and then the folder. This guard exists so that a single short command cannot wipe out a large tree by mistake. Option A is wrong because nothing inside is touched without the recursive switch. Option B is wrong because a file system cannot leave files with no parent folder; the entries go together or not at all. Option C is wrong because the plain command does not ask item by item, which is what an interactive option like rm -i does. Exam tip: rmdir empties only, rm -r for the whole tree.

View all
Q2.Computer AwarenessAsked in: CDS · CDS-I 2025, GKEasy

Which one of the following is the characteristic of Artificial Intelligence ?

  1. A.Replicates human decision making
  2. B.Stores relevant information
  3. C.Stores similar kind of data for a specific purpose
  4. D.Allows user to interact with media
Show answer
Correct answer: A. Replicates human decision making

Artificial Intelligence is the ability of a machine to perform tasks that normally need human intelligence, such as reasoning, learning and taking decisions.