MCQ

Linux MCQs – File Management – Part 2

Multiple choice questions and answers (MCQs) on Linux focuses on “Managing of users accounts and groups” to prepare for exams, interviews, and certifications, such as Redhat exam, CompTIA exam, Ubuntu / SuSE certification, LPI certification exam. These MCQs will easily prepare anyone to pass their Linux test.
 

1. Which of the following times does not exist in a traditional unix file system?

A Access time

B Modification time

C Creation time

D Change time

C
The creation time does not exist in the traditional unix file system.

 

 
 

2. Which one represents the user’s home directory?

A /

B .

C ..

D ~

D
The ~ sign represents the user’s home directory.

 

 

3. Which option of the “rmdir” command deletes all directories rep1, rep2, rep3 if the path is rep1/rep2/rep3?

A –b

B –o

C –p

D –t

C
The “rmdir -p” command in Unix allows you to delete parent directories if they are also empty. For example:

$ rmdir -p rep1/rep2/rep3

this command will first delete rep3/, then rep2/ and finally rep1/ thus deleting the whole directory tree specified in the command’s argument.

 

 

4. Which command is used to set the file size limit?

A fsize

B flimit

C ulimit

D usize

C
The operating system allows to limit the amount of resources that can be used, using the “ulimit” command.

 

 
 

5. If a file is deleted under Unix using “rm” then?

A The file can be recovered by a normal user

B The file cannot be recovered by a user

C The file can be fully recovered as long as the system is not rebooted

D The file will be moved to the /lost directory and can only be recovered by the administrator

B
The file cannot be recovered by the user if it has been deleted by the “rm” command.

 

 

6. When the following command $ mv file1 file2 is executed which file inode is released?

A file1

B file2

C a new inode is used

D no inodes are released

B
Renaming a file in Linux releases the inode number to be reused, in this case the inode of “file2” will be released.

 

 

7. Which command is used to copy files and directories?

A copy

B cp

C cpy

D cpr

B
“cp” means copy. This command is used to copy files or a group of files or directories. It creates an exact image of a file on a disk with a different file name.

 

 

8. The attribute information of a file is stored in which structure on the disk?

A Inode

B Data blocks

C File blocks

D Directory file

A
Each inode stores the attributes and location of the object’s data blocks.

 

 
 

9. How do you rename the file “toto” to “tata”?

A $ mv toto tata

B $ move toto tata

C $ cp toto tata

D $ rn toto tata

A
The “mv” command is used to rename files and directories.

 

 

10. Running the ‘cd ..’ command at the root level results in _______ ?

A An error message indicating that the user cannot access beyond the root level

B The behavior depends on the version of unix

C Results by changing to the ‘home’ directory

D Nothing happens

D
The root directory / is the highest directory in the tree, so running the command ‘cd ..’ at the root level does not result in any action.

 

 
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *