Unit 4 - Practice Quiz

INT249

1 Which of the following best describes the core Linux design philosophy regarding the file system?

A. Everything is a process
B. Everything is a file
C. Everything is a database entry
D. Everything is a network socket

2 Which command is used to display the manual page for a specific command in Linux?

A. help
B. doc
C. man
D. guide

3 To execute a command with superuser (root) privileges while logged in as a standard user, which command should be prefixed to the desired command?

A. su
B. sudo
C. admin
D. root

4 Which shell command changes the current working directory to the user's home directory?

A. cd /home
B. cd ~
C. cd ..
D. cd -

5 Which file contains the system-wide configuration for the sudo command and defines which users can acquire privileges?

A. /etc/passwd
B. /etc/shadow
C. /etc/sudoers
D. /etc/group

6 Which command is used to create a new user account in Linux?

A. newuser
B. useradd
C. createuser
D. mkuser

7 When deleting a user with userdel, which flag is used to also remove the user's home directory and mail spool?

A. -f
B. -r
C. -d
D. -h

8 Which file stores the encrypted password information for user accounts?

A. /etc/passwd
B. /etc/security
C. /etc/shadow
D. /etc/master.passwd

9 Which command allows an administrator to modify an existing user account, such as adding them to a supplementary group?

A. usermod
B. useradd
C. groupmod
D. passwd

10 What is the primary function of the /etc/skel directory?

A. It stores deleted user files
B. It contains system skeleton drivers
C. It contains default files copied to a new user's home directory upon creation
D. It stores temporary skeleton scripts

11 Which command displays the current user's UID (User ID) and GID (Group ID)?

A. whoami
B. w
C. finger
D. id

12 To add a new group to the system, which command is used?

A. groupadd
B. addgroup
C. newgroup
D. mkgroup

13 If you wish to lock a user account so they cannot log in, which command would you use?

A. passwd -l
B. usermod -L
C. Either A or B
D. userdel --lock

14 Which directory contains the essential user command binaries available to all users (e.g., ls, cp)?

A. /sbin
B. /bin
C. /boot
D. /dev

15 What does the permission string drwxr-xr-x indicate?

A. It is a file readable by everyone
B. It is a directory with full permissions for the owner, and read/execute for group and others
C. It is a directory with full permissions for everyone
D. It is a device file

16 Which numeric value corresponds to the permission r-x (read and execute)?

A. 4
B. 5
C. 6
D. 7

17 You want to change the owner of a file to john and the group to devs. Which command performs this?

A. chmod john:devs file.txt
B. chown john:devs file.txt
C. chgrp john:devs file.txt
D. chperm john:devs file.txt

18 Which command changes the permissions of a file?

A. chown
B. chgrp
C. chmod
D. umask

19 If the umask is set to $022$, what are the default permissions for a newly created file (assuming the base is $666$)?

A. 644
B. 755
C. 600
D. 777

20 Which special permission bit, when set on a directory, ensures that users can only delete files they own within that directory?

A. SUID
B. SGID
C. Sticky Bit
D. Execute

21 What is the numeric representation of the Sticky Bit?

A. 4000
B. 2000
C. 1000
D. 0100

22 What happens when the SGID (Set Group ID) bit is set on a directory?

A. Files created inside inherit the owner of the directory
B. Files created inside inherit the group of the directory
C. The directory cannot be deleted
D. Scripts run inside run as root

23 Which command allows you to view the absolute path of the current directory?

A. ls
B. pwd
C. cd
D. whereis

24 Which partition table type is required for drives larger than 2TB and supports more than 4 primary partitions?

A. MBR
B. GPT
C. FAT32
D. LVM

25 Which command is used to manipulate MBR partition tables?

A. gdisk
B. fdisk
C. mkfs
D. mount

26 In Linux device naming, what does /dev/sda typically represent?

A. The first SATA/SCSI hard drive
B. The sound card
C. The first partition on the first drive
D. The CD-ROM drive

27 Before a Logical Volume (LV) can be created in LVM, which of the following must be created first?

A. Volume Group (VG)
B. File System
C. Mount Point
D. Swap Space

28 Which command initializes a physical disk or partition for use by LVM?

A. vgcreate
B. lvcreate
C. pvcreate
D. lvm init

29 Which command creates a specific file system (formats) on a partition?

A. fdisk
B. mount
C. mkfs
D. dd

30 Which command makes a file system accessible at a specific location in the directory tree?

A. boot
B. load
C. mount
D. attach

31 To ensure a file system mounts automatically after a reboot, which file must be edited?

A. /etc/mtab
B. /etc/fstab
C. /etc/mounts
D. /etc/partitions

32 What does the command chmod 750 script.sh do?

A. Owner: rwx, Group: r-x, Others: ---
B. Owner: rwx, Group: rwx, Others: ---
C. Owner: r-x, Group: r-x, Others: ---
D. Owner: rwx, Group: rwx, Others: rwx

33 Which command displays disk usage by directory?

A. df
B. du
C. ls
D. top

34 Which command reports file system disk space usage (free and used space on mounted filesystems)?

A. df
B. du
C. free
D. mem

35 If a user tries to edit a file and receives 'Permission Denied', which of the following is the most likely cause?

A. The file system is full
B. The user does not have write permission on the file
C. The file is a directory
D. The user is root

36 What is the purpose of the SUID (Set User ID) bit on an executable file?

A. It prevents the file from being deleted
B. It executes the file with the permissions of the file owner, not the user running it
C. It executes the file with root permissions always
D. It allows the file to be shared via network

37 Which command is used to rename a file or directory?

A. rn
B. ren
C. mv
D. cp

38 What does the symbol .. represent in a file path?

A. Current directory
B. Root directory
C. Parent directory
D. Home directory

39 Which command is used to change the group ownership of a file?

A. chown
B. chgrp
C. chmod
D. groupmod

40 Which file defines the password aging policies (min/max days, warning period) for users?

A. /etc/passwd
B. /etc/shadow
C. /etc/login.defs
D. /etc/profile

41 How do you apply changes made to /etc/fstab without rebooting?

A. mount -a
B. remount
C. fstab -u
D. init 6

42 Which command is used to remove a directory that is NOT empty?

A. rmdir
B. rm -r
C. del
D. erase

43 In the context of ls -l, what does the character l at the beginning of the permission string (e.g., lrwxrwxrwx) indicate?

A. Log file
B. List
C. Symbolic Link
D. Loopback device

44 Which command allows you to view the groups a specific user belongs to?

A. groups username
B. who username
C. lsgroup username
D. cat /etc/group

45 What is the purpose of the fsck command?

A. File System Create
B. File System Check and Repair
C. File System Kill
D. File System Copy

46 When configuring a new user profile, which file is executed specifically when a login shell is started?

A. .bashrc
B. .bash_profile
C. .bash_logout
D. .inputrc

47 Which command would you use to extend a Logical Volume named lv_data by 10GB?

A. lvextend -L +10G /dev/vg01/lv_data
B. lvresize +10G
C. vgextend +10G
D. mkfs +10G

48 What does the command history do?

A. Shows file access history
B. Shows user login history
C. Shows a list of previously executed commands
D. Shows system boot history

49 If you need to change a user's login shell from /bin/bash to /bin/zsh, which command is most appropriate?

A. chsh
B. chmod
C. chown
D. shellmod

50 Which option is used with the cp command to copy directories recursively?

A. -d
B. -r
C. -f
D. -x