Linux Quizzes #1-6
Which prompt does the root user receive when logged in to the system?
#
(1/2) Which of the following files will be executed immediately after a user logins in (with a password) to a Linux system and receives a BASH shell? Assume that all of these files exist and we adopt the current settings of Fedora distributions. (2/2) Which of the following files will be executed immediately after a user receives a BASH shell without login? Same assumptions as above?
(1/2) /etc/profile ~/.bash_profile ~/.bash_login ~/.bashrc (2/2) /etc/bashrc ~/.bashrc
After typing the command umask 731, the permissions on all subsequently created files and directories will be effected. In this case, what will the permission on all new files be?
--r--rw-
The command chmod 4256 file1 would product which of the following permissions?
--wSr-xrw-
The command chmod 317 file1 would produce which of the following permissions?
--wx--xrwx
The command chmod 7751 file1 would produce which of the following permissions?
-rwsr-s--t
Which of the two partitions do you typically create at minimum during a Red Hat Linux installation?
/ & /swap
Given the following configurations, which filesystems will be automatically checked on boot by the fsck command?
/, /proc, and swap
Which of the following is an absolute pathname in Linux?
/home/resume
Which of the following file descriptor numbers represents stdin?
0
Which of the following kernels are developmental kernels?
2.3.6, 2.5.5 are examples
What is the main purpose of the swap partition? How to determine it's size?
2x ram
How many primary partitions may a hard disk have?
4
What is the default shell in Red Hat Linux called?
BASH
Which of the following features are provided by a shell?
Batch processing (via shell scripts) Command history Job control Metacharacters
How do you indicate a comment line in a shell script?
Being the line with #
Which of the following statements are true about a hard link?
Creating a hard link does not require using a new inode Hard link cannot be linked to a file that is located on another partition Hard link cannot be linked to a folder
When sitting at a computer running Linux, what key combination is preset to open the graphical terminal?
Ctrl+Alt+F1 (maybe Ctrl+Alt+G)
A directory is NOT a type of file? T/F
False
Because Standard Error and Standard Output represent the results of a command and Standard Input represents the input required for a command, only Standard Error and Standard Output can be redirected to/from a file. T/F
False
Both PS1 and HOME are environmental variables because they always exist in the shell (or a subshell). T/F
False
Linux commands entreated via the command line are not case sensitive T/F
False
The less command offers less functionality than the more command. T/F
False
Which common GUI environments are available in most Linux distributions?
GNOME and KDE
To which license does Linux adhere?
GNU Public license
What does << accomplish when used at cat >file1 <<bye?
It indicates the end of inputs is bye
A proton can be referenced by which of the following manner in /etc/fstab?
Its name under the /dev folder Its UUID Its label
When the core components of the Linux operating system are packaged together with other Open Source Software, it is called a:
Linux distribution
Jim just purchased two new SCSI hard disk drives and a controller card for them. He properly installs the hardware in his machine. Before he can use them for data storage and retrieval, what must he do?
Mount any partitions created so accessible by OS Format any partitions created w/ valid filesystem (rec. by Linux) Use the fdisk command to create one or more partitions on each of the drives
How can you protect a meta character (such as the $ character) from shell interpretation?
Precede it with a \
Which of the following statements about quota are true?
Quotas can limit both user space and then number of files a user can own Hard limits can never be exceeded Soft limits allow a user to exceed them for a certain period of time
Consider the following shell script. What would be displayed if a user executes this program and answers Blue when prompted? echo -e "What is your favorite color?--> \c" if [ "$REPLY" = "red" -o "$REPLY" = "blue" ] then echo "The answer is red or blue." else echo "The answer is not red nor blue." fi
The answer is not red nor blue.
What is wrong with the following command string ls /etc/hosts >list file 2>list file?
The file list file may contain the results in an unexpected order
As the root user, you tried to delete a file. Yet, it was rejected. Why?
The file's attributes may have been modified by chattr to be non-removable
Linux has only one root (/) directory per directory tree. T/F
True
Which of the following can switch modes when using a vi editor?
Type in a (:), (?), or (/) character Press the Esc key Type in one of the following a, i, o, or r letters
A user mounts a device to a directory and realizes afterward there a files previously found within the mount point directory that are needed. What should this user do?
Unmount the device from the directory.
What must you do to successfully run the fsck command on a filesystem?
Unmount the filesystem
You would like to grant the red permission on a file (name my_file) to a regular user named Alex. The file's current permission and ownership information is listed below? What would be the most appropriate way to do it? [Instructor@ClassDemoFC-001 tmp]$ ll my_file -rw-rwxr--+ 1 root tmp 332183 Sep_29 10:15 my_file
Use sefacl to give rex permission to Alex these work whether appropriate or not -chmod 677 my_file Add Alex to the group name tmp Change the group owner to be Alex's group
After typing the ls -l command, you see the following line in the output: -rw-r-xr-- 1 user1 root 0Apr29 15:40 file1
User1 has read and write, Members of root group have read and execute, all others have read permissions to the file
What would be the effect of using the alias command to make an alias for the date command named cat in honor of your favorite pet?
When you use the cat command at the command prompt with the intention of viewing a text file, the date appears instead
Which of the following filesystems can be recognized by Linux?
XFS ext2 ext3 ext4
In vi, how to go to the first character on a given line
^ (check this) other possible answers (gg, G, $)
What are the two major purposes of MBR?
boot loader & partition table
You want to see the filesystems that are presently in use on the system. What command could you use?
cat /etc/mtab mount
When applied to a directory, the SGID special permission ---.
causes all new files created in the directory to have the same group membership as the directory and not the entity that created them.
Is a user's current directory is /home/mary/project1, which command could she use to move to the etc directory directly under the root?
cd /etc
Which of the following commands can change the group ownership?
chgrp, chown
A file has the following permissions -r----x-w-. The command chmod 143 would have the same effect as the command ---.
chmod u=x, g=r, o=wx file1
Which of the following commands will change the user ownership and group ownership of file1 to user1 and root respectively?
chown user1:root file1 chown user.root file1
Which command blanks the terminal screen erasing previously displayed output?
clear
The vi editor can function in which of the following modes?
command input VI
Which of the following commands create a symbolic link?
cp -s file s-file ln -s file s-file
Which command is used to display the amount of free space that exists on a filesystem?
df
The tac command ---.
displays the contents of a file in reverse order last line first and first line last
Which command can be used to show the value of variable in the shell?
echo
Which of the following command will return the PID (process ID) of the current bash?
echo $$
Before a user-defined variable can be used by processes than run in subshells, that variable must be ---.
exported
In vi how to go to the first line of a file?
gg
What commands can you use to safely shut down the Linux system immediately?
halt or shutdown -h now (ask, butinternet says halt)
After typing the ls -a command, you notice that there is a file whose filename beings with a dot ( . ). What does this mean?
it is a hidden file
You know a Linux command will perform a desired function for you, but you cannot remember the full name of the command. You do remember it will flush a variable from your system. Which command typed at a command prompt displays a list of commands that would likely contain the command you desire?
man -k flush
What equivalent to the man command generally provides and easier-to-read description of the queried command and also contains links to other related information?
man help (1 of these might be wrong) and/or info
Describe two different ways to obtain hardware information so as to prepare for a Linux installation.
manufacturers info & system info
Which command i used to format a partition on a hard disk rive?
mkfs -t type device
Which command mounts all existing filesystems listed in /etc/fstab?
mount -a
Linus is a --- and --- operating system?
multiuser, multitasking
What would be displayed if a user executed ls /etc/hello 2>/dev/null || echo "not exist" && echo "exist" ? Assume that there is no file named hello under /etc.
not exist
How many extended partitions may a hard disk have?
only 1
Explain one of the major problems of MBR?
only allows 4 partitions
Which command would a user type on the command line to find out what directory in the directory tree he is currently in?
pwd
What will typing q! at the : prompt in command mode do when using the vi editor?
quit without saving any changes
A special device file is used to ---?
represent hardware devices such as hard disk drives and ports
The default permissions given by the system prior to analyzing the umask are --- for directories, and -- for files.
rwxrwxrwx and rw-rw-rw-
Which of the following refers to the third primary partition on the second SATA hard disk within Linux?
sdb3
Which command could you use to see a list of exported environment variables and user-defined shell variables as well as their current values?
set
After a user logs in to a terminal, he receives a user interface called a ---?
shell
What does the du -h /var command do?
shows the size of all directories within the /var directory
How to load a bash profile named .bashrc in the current working directory?
source .bashrc . .bashrc
Which command searches for and displays any text contents of a binary file?
strings
The core component of the Linux operating system is the Linux kernel if you were a Linux systems administrator for a company, when would you need to upgrade your Linux kernel?
when you need to have support in Linux for new hardware when you need to increase the stability of Linux when you need to have better system security
Which command displays the users who are currently logged into the linux system?
who & w