1.
You receive a message that you’ve successfully backed up hda2 on your Linux system. What is hda2?
Correct Answer
B. 2nd partition on your main HD
Explanation
Hda2 refers to the 2nd partition on the main hard drive of the Linux system. This means that the hard drive has been partitioned into multiple sections, and hda2 specifically represents the second partition.
2.
You have purchased a special monitor for your computer and the instructions tell you to make a minor modification to the inittab file. Where would you locate this file on a typical Linux system?
Correct Answer
D. /etc
Explanation
The inittab file is typically located in the /etc directory on a Linux system. This directory contains system configuration files, including important files related to the initialization process. Therefore, it is the most likely location for the inittab file, as mentioned in the instructions for the special monitor.
3.
While you are typing a command, you misspell the name of a file you want to specify with the command. Which of the following command line key combinations enables you to go back and fix your error?
Correct Answer
D. Ctl+b
Explanation
The correct answer is ctl+b. Pressing the "ctl" (control) key and the "b" key together allows you to move the cursor back one character at a time, giving you the ability to fix the misspelled file name in the command.
4.
You haven’t changed your user account password for several months and now decide to create a new password. Which of the following commands should you use?
Correct Answer
C. Passwd
Explanation
The correct answer is "passwd." The "passwd" command is used to change the user account password in Unix-like operating systems. By using this command, you can create a new password for your user account. The other options provided ("password," "pword," and "psswd") are not valid commands for changing the password.
5.
The default command interpreter for Linux is ----------------
Correct Answer
Bash shell
Explanation
The default command interpreter for Linux is the Bash shell. Bash stands for "Bourne Again SHell" and it is a widely used command-line interpreter that provides a user interface for executing commands and managing the operating system. It is the default shell for most Linux distributions due to its powerful features, extensive support, and compatibility with the POSIX standard. Bash shell allows users to interact with the Linux system, run scripts, and perform various administrative tasks efficiently.
6.
You’re frantically trying to get ready for a meeting and want to access a file in your home directory, but you are currently working in a public directory open to all users. What command can you enter to instantly go to your home directory?
Correct Answer
cd ~
Explanation
The command "cd ~" is used to instantly go to the home directory. The "~" symbol represents the user's home directory, so when this command is entered, it changes the current directory to the user's home directory. This allows the user to quickly access the file they need for the meeting without having to navigate through the entire directory structure.
7.
Your new colleague asks which partitions vendors recommend setting up on a Linux system. Which of the following partitions do you include in your response?
Correct Answer
D. All the above
Explanation
The correct answer is "all the above" because vendors typically recommend setting up multiple partitions on a Linux system. The root partition is where the operating system and system files are stored, the swap partition is used for virtual memory, and the /boot partition contains the bootloader and kernel files. Having separate partitions for these components can help with system stability, security, and performance.
8.
You have mounted a remote network drive and now you want to unmount that drive. Which of the following commands do you use? (Choose all that apply.)
Correct Answer
B. Umount
Explanation
Mount Command:
Used to connect files to directory tree.
Any file that is mounted can be and can only be accessed
mount [-option] [device-name mount point]
Eg., mount -t iso9660 /dev/cdrom /mnt/cdrom -t specifies if there is mounting type
mount -t file system /dev/fd0 /mnt/floppy
The device is accessed through the mounting point at /mnt or at /media
9.
When you connect a printer via a USB port on your Linux computer, which type of device special file is used to handle streams of data sent to and from the printer?
Correct Answer
A. Character special file
Explanation
When you connect a printer via a USB port on your Linux computer, the type of device special file used to handle streams of data sent to and from the printer is a character special file. A character special file is a type of special file that allows for the transfer of data one character at a time, making it suitable for devices that require streaming data, such as printers.
10.
Some of the users in your company create and delete so many files that they have problems with fragmented disks. Which of the following new features in the ext4 file system help to reduce fragmentation problems?
Correct Answer
D. Extents
Explanation
Unix File System (ufs)
--------------------------------
Advantages:
Expandable
Supports large amount of storage
Excellent security
Reliable
Supports Journaling
Supports hot fixes
Ext fs is dafault and modeled after ufs
Ext1 - did not support journaling and had bugs;
Ext2 - reliable and large disk storage
Ext3 - has journaling
Ext4 - allows single volume storage upto 1 Exabyte (> 1.1 quintillion of bytes, nearly 10^18 in decimal) and enable extent use
11.
In UNIX and Linux systems, what source of extra memory space is used when working on tasks and files that exceed the RAM capacity on chips in the computer?
Correct Answer
B. Swap partition
Explanation
In UNIX and Linux systems, when working on tasks and files that exceed the RAM capacity, a swap partition is used as a source of extra memory space. A swap partition is a dedicated portion of the hard drive that is used as virtual memory to temporarily store data that cannot fit in the RAM. This allows the system to continue functioning even when the RAM is fully utilized, by swapping data between the RAM and the swap partition as needed.
12.
You are always scheduled for two or three meetings each day and need to keep an eye on the time. What PS1 variable parameter can you set in order to have your command prompt display the current time?
Correct Answer
A. \t
Explanation
echo $PS1 - shows the prompt configuration
characters being with \ are special shell formatting characters.
Eg. \u - prints username
-h - hostname
\W - current working directory
\$ prints $ for normal users and # for administrator
[ ] and white space - are not special characters so printed as it is.
Eg.$ echo $PS1 will show something like
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}meenu:\w\$ - in debian or ubuntu
or as [\u@\h \W]\$
will display as [meenu@my ~/Documents]$
this can be changed with
export PS1="[\u@\t \W]$" - add this line at the end of your $HOME/.bashrc file
then run
source $HOME/.bashrc
Other variables to configure - path, pwd, prompt, shell
13.
A member of your department has given you permissions to view the contents of the accounting directory under her home directory. The name of her home directory is sweet. Which of the following commands should you use to display the contents of the accounting directory?
Correct Answer
B. Ls /home/sweet/accounting
Explanation
The correct command to display the contents of the accounting directory is "ls /home/sweet/accounting". This command uses the "ls" command to list the contents of a specific directory, in this case, the accounting directory located under the home directory named "sweet". The "/home/sweet/accounting" specifies the exact path to the directory.
14.
It’s late and you have been working all day to finish a report. Before you go home you want to copy several files including your report file. What copy command should you use to ensure that you don’t inadvertently copy an older report file over the newer report file you’ve been working on for the last four hours?
cp -u
Correct Answer
C. cp -u
Explanation
The correct answer is "cp -u". The -u option in the cp command stands for "update". When used with the cp command, it ensures that only files that are newer or do not exist in the destination directory are copied. This means that if you use the cp -u command to copy your report file, it will not copy an older report file over the newer one that you have been working on for the last four hours.
15.
Which of the following are file systems supported by UNIX and Linux operating systems? (Choose all that apply.)
Correct Answer
E. All the above
Explanation
UNIX and Linux operating systems support multiple file systems, including NTFS, vfat, ufs, and ext. Therefore, the correct answer is "all the above."
16.
Your boss is planning to do some house cleaning by deleting several old files. However, she mentions that she doesn’t want to delete an important file inadvertently. What command can she use so that she is prompted to make sure she wants to delete a particular file?
Correct Answer
C. Rm -i
Explanation
The correct answer is "rm -i". The "rm" command is used to remove files, and the "-i" option stands for "interactive", which prompts the user for confirmation before deleting each file. This ensures that the boss will be asked for confirmation before deleting any file, preventing the accidental deletion of important files.
17.
A friend of yours is trying to make more space on his hard disk drive and is considering deleting the /lib directory because he has heard it mostly contains games that he doesn’t use. What is your recommendation?
Correct Answer
C. Keep the /lib directory because it holds security information, shared library images, kernel modules and other important files
Explanation
The /lib directory should be kept because it contains important files such as security information, shared library images, and kernel modules. Deleting this directory could potentially cause issues with the functioning of the operating system and other software on the hard disk drive. It is not advisable to delete the /lib directory without understanding its significance and potential consequences.
18.
You are curious about the error and system logs kept by your operating system. In what main directory under the root (/) would you most likely find these logs?
Correct Answer
C. /var
Explanation
System logs and error logs are typically stored in the /var directory. This directory is commonly used to store variable data such as log files, temporary files, and system-related information. The /sbin directory contains system binaries and administrative commands, the /tmp directory is used for temporary files, and the /sys directory contains information about the system's hardware and devices. However, the most likely location for logs would be the /var directory.
19.
You have created many notes to yourself that end in .txt. Which of the following commands enables you to list all of the .txt files in your home directory while you are in the Bash shell?
Correct Answer
B. Ls *.txt
Explanation
The correct answer is "ls *.txt". The "ls" command is used to list files and directories. Adding "*.txt" after "ls" specifies that we want to list all files with the extension ".txt". This command will display a list of all the .txt files in the current directory.
20.
Which command enable you to set permissions on a directory after you create it?
Correct Answer
chmod
Explanation
Can also use the format $chmod ugo+rwx filename
21.
Where is virtual memory located?
22.
You have many files that begin with the word “account” and that end with two digits to designate a year, such as account00, account 01, and so on. What is the command that enables you to view all of these files that start with account?
Correct Answer
C. Ls account??
Explanation
The correct answer is "ls account??". This command uses the wildcard character "?" to match any single character, so it will display all files that start with "account" and have two more characters after that.
23.
When your system boots, it reads a list of mounting instructions from
Correct Answer
A. /etc/fstab
Explanation
When a system boots up, it reads a list of mounting instructions from the /etc/fstab file. This file contains information about the file systems and partitions that should be mounted at boot time, including their device names and mount points. By reading this file, the system knows which file systems to mount and where to mount them, ensuring that all necessary file systems are available for use after booting up.
24.
Your company is discussing plans to migrate desktop and laptop users to Linux. One concern raised by the users is whether Linux supports the use of CDs and DVDs for both work files and for listening to music. Which of the following is an appropriate answer?
Correct Answer
D. Linux supports both the UDF and iso9660 file systems for CD and DVD use
Explanation
HPFS - High Performance Files System - to use with os/2 operating system
JFS - Journaled File System (by IBM) - larger files, dynamic inode allocation for better use of free space
MS-DOS - compatibility with FAT12 & FAT16 to read floppy disks made in windows
NFS - Sun Microsystem for unix systems for networking and sharing of files
NTFS - used by windows
Reiser FS - by Hans Reiser; Similar to ext3 & ext4 (with journaling) but 15 times faster than these; handles small files and encourages efficient coding through small files
UDF - Universal Disk Format - for CD & DVD use replacing iso9660 (supported by Unix/Linux, Windows, Mac)
Vfat - compatible with FAT32 - for long file names
25.
New users can be added using the command
Correct Answer(s)
A. Useradd
B. Adduser
Explanation
The correct answer is useradd, adduser. These are the command options that can be used to add new users. The "useradd" command is used to create a new user account, while "adduser" is a higher-level command that provides a more user-friendly interface for adding new users. Both commands serve the same purpose of adding new users to the system.