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?
- A.The operating system will automatically delete all files and subdirectories within it.
- B.Only the directory structure will be removed, leaving the files and subdirectories orphaned.
- C.The operating system will prompt the user for confirmation to delete each item within the directory.
- D.The operating system will return an error indicating that the directory is not empty
Correct answer
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.
Practice Questions
View allWhich language uses the symbolic representation of machine codes needed to program a particular processor or processor family?
- A.Machine Language
- B.Assembly Language
- C.High-Level Language
- D.All of the above
Show answer
Assembly language replaces the binary machine codes of a processor with short symbols called mnemonics, such as MOV, ADD and JMP.
Read the full explanation →Which one of the following is the characteristic of Artificial Intelligence ?
- A.Replicates human decision making
- B.Stores relevant information
- C.Stores similar kind of data for a specific purpose
- D.Allows user to interact with media
Show answer
Artificial Intelligence is the ability of a machine to perform tasks that normally need human intelligence, such as reasoning, learning and taking decisions.
Read the full explanation →What is an interactive combination of text, graphics, video, audio and images termed as ?
- A.JPEG
- B.Multimedia
- C.AVA
- D.PNG
Show answer
Multimedia means using several forms of media, such as text, graphics, audio, video, images and animation, together, often in a way the user can interact with.
Read the full explanation →Which among the following is a malicious software?
- A.Hacking
- B.Password Cracking
- C.Trojan Horse
- D.Firewall
Show answer
A Trojan is a program that looks useful or harmless but secretly carries harmful code, so it is a piece of malicious software, or malware.
Read the full explanation →Which one of the following is not an application software?
- A.Spreadsheet
- B.AutoCAD
- C.MS PowerPoint
- D.Linker
Show answer
A linker is system software, a programming tool that joins compiled pieces of code into one program that can run; it does not do a task for the end user.
Read the full explanation →