Ramdom Flashcards
What type of file system is created by mkfs when it is executed with the block device name only and withouth any additional params
ext2
What of the following statements are true regarding /dev/ when using udev?
Additional rules for udev can be created by adding them to /etc/udev/rules.d/
The /dev/ directory is stored in /etc/udev/dev and is restored during system startup.
The system is having trouble and the engineer wants to bypass the usual /sbin/init start up and run /bin/sh. What is the usual way to pass this change to the kernel from your boot loader
Pass init=/bin/sh on the kernel param line.
Which umask value ensures that new directories can be read, written and listed by their owning user, read and listed by their owning group and are not accessible at all for everyone else?
0027
What command changes the number of days before the ext3 filesystem on /dev/sda1 has to run through a full filesystem check while booting?
tune2fs -i 200 /dev/sda1
Command converts spaces in a file to tab characters and prints the result to standard output
unexpand
which utility would be used to change how oftten a filesystem check is performed on an ext2 filesystem without losing any data stored on that filesystem
tune2fs
what is the default percentage of reserved space for the root user on a new ext4 filesystem
5%
What happens when a file system that is not listed in /etc/fstab nor known to the system is manually mounted
the command systemctl mountsync can be used to create a mount unit based on the existing mount
What is true about mount points
Every existing directory can be used as a mount point.
Kernel parameter that instructs the kernel to suppress most boot messages
quiet
FILL BLANK -
Which program updates the database that is used by the locate command? (Specify ONLY the command without any path or parameters).
updatedb
What does the command mount –bind do?
It makes the contents of one directory available in another directory
Consider following output
525385 -rw-rw-r– 2 1000 1000 0 Feb 12 19:44 a.txt
526255 lrwxrwxrwx 1 1000 1000 5 Feb 12 19:44 b.txt -> a.txt
How would a new file named c.txt be created with the same inode number as a.txt (Inode 525385)?
ln a.txt c.txt
what commands will display all currently mounted filesystems
cat /proc/self/mounts
mount
Command can perform full text search on all available packages on debian system
apt-cache
updates linker cache of shared libraries
ldconfig
Consider the following directory:
drwxrwxr-x 2 root sales 4096 Jan 1 15:21 sales
Which command ensures new files created within the directory sales are owned by the group sales? (Choose two.)
chgrp -p sales sales
chmod 2775 sales
FILL BLANK -
Which command displays the current disk space usage for all mounted file systems? (Specify ONLY the command without any path or parameters.)
df
Which chown command changes the ownership to dave and the group to staff on a file named data.txt?
chown dave:staff data.txt
When considering the use of hard links, what are valid reasons not to use hard links?
Hard links are specific to one filesystem and cannot point to files on another filesystem
hard links are not availabel on all Linux systems because traditional filesystems, such as ext4, do not suport them
In compliance with the FHS in what directory are man pages found?
/usr/share/man
FILL BLANK -
Which file in the /proc filesystem lists parameters passed from the bootloader to the kernel? (Specify the file name only without any path.)
cmdline
/proc/cmdline
What is the process ID number of the init process on a SysV init based system?
1
Which daemon handles power management events on a Linux system?
acpid
what information is stored in the BIOS
Boot device order
Hardware configuration
Which of the following statements are true about the boot sequence of a PC using a BIOS? (Choose two.)
Some parts of the boot process can be configured from the BIOS
The BIOS initiates the boot process after turning the computer on
During a system boot cycle, what program is executed after the BIOS completes its tasks?
The bootloader
What is true regarding UEFI firmware?
It can use and read certain file systems
It is stored in a special area within the GPT metadata
A faulty kernel module is causing issues with a network interface card. Which of the following actions ensures that this module is not loaded automatically when the system boots?
Adding a blacklist line including the name of the offending module to the file /etc/modprobe.d/blacklist.conf
When is the content of the kernel ring buffer reset?
When the ring buffer is explicitly reset using the command dmesg –clear
When the system is shut down or rebooted
which command displays the contents of the Kernel Ring Buffer on the command line?
provide only the command name without any options or path information.
dmesg
/bin/dmesg
What commands reboot the system with using SysV init
shutdown -r now
telinit 6
What is the first program the Linux kernel starts at boot time when using System V init?
/sbin/init
A Debian package creates several files during its installation. What command searches for packages owning the file /etc/debian_version?
dpkg -S /etc/debian_version
how is symbolic link called bar.conf pointing to foo.conf created
ln -s foo.conf bar.conf
What is contained on the EFI System Partition?
The first stage boot loader
directories on a 64 bit Linux system typically contain shared libraries?
~/.lib64/
/lib64/
What is the name of the main config file for GUN GRUB
menu.lst
grub.cfg
grub.conf
files exist in a standard GRUB 2 installation?
/boot/grub/i386-pc/lvm.mod
/boot/grub/grub.cfg
commands installs all packages with a name ending with the string foo?
zypper install “*foo”
updates already installed RPM package rpmname
rpm -U rpmname
You want to preview where the package file, apache-xml.i386.rpm, will install its files before installing it what commnd do you issue
rpm -qpl apache-xml.i386.rpm
properties of a Linux system should be changed when a virtual machine is cloned?
The permissions of /root/
The SSH host keys
what does the command grub-install /dev/sda do
installs all required files and configures the boot loader on device/dev/sda
partition types is used for Linux swap spaces when partitioning hard disk drives?
82
What is true regarding the configuration of yum?
The configuration of package repositories can be divided into multiple files
in case /etc/yum.repos.d/ contains files, /etc/yum.comf is ignored
Repository configurations can include variables such as $basearch or $releasever
Which Debian package management tool asks the configuration questions for a specific already installed package just as if the package were being installed the first time
dpkg-reconfigure
After moving data to a new filesystem, how can the former pat of the data be kept intact in order to avoid reconfig of existing apps
by creating symbolic link from old to the new path of data
by mounting the new filesystem on the original path of the data.
Command used to update the list of available packages when using dpkg based package management
apt-get update
apt-get subcommands installs the newest versions of all currently installed packages?
dist-upgrade
apt-get command will install the newest versions of all currently installed packages without removing any packages or installing new packages that are already installed.
upgrade
uninstalls a package but keeps its configuration files in case the package is re-installed?
dpkg -r pkgname
In which directory must definition files be placed to add additional repositories to yum
/etc/yum.repos.d
lists the dependencies of the RPM package file foo.rpm?
rpm -qpR foo.rpm
What is the maximum niceness value that a regular user can assign to a process with the nice command when executing a new process?
19
list all files and directories within the /tmp/ directory and its subdirectories which are owned by the user root?
find /tmp -user root -print
find -path /tmp -user root - print
valid stream redirection operators within Bash?
<
«<
>
vi commands deletes two lines, the current and the following line?
2dd
The command dbmaint & was used to run dbmaint in the background. However, dbmaint is terminated after logging out of the system. Which alternative dbmaint invocation lets dbmaint continue to run even when the user running the program logs out?unning the program logs out?
bg dbmaint
From a Bash shell, which of the following commands directly execute the instructions from the file /usr/local/bin/runme.sh without starting a subshell?
source /usr/local/bin/runme.sh
. /usr/local/bin/runme.sh
FILL BLANK -
Which program runs a command in specific intervals and refreshes the display of the program’s output? (Specify ONLY the command without any path or parameters.)
watch
Immediately after deleting 3 lines of text in vi and moving the cursor to a different line, which single character command will insert the deleted content below the current line?
p (lowercase)
Which of the following commands changes all CR-LF line breaks in the text file userlist.txt to Linux standard LF line breaks and stores the result in newlist.txt?
tr -d ‘\r’ < userlist.txt > newlist.txt
txt1.txt
atxt.txt
txtB.txt
What expression turns this input stream into the following output stream? txt1.bak.txt atxt.bak.txt txtB.bak.txt
s/txt/bak.txt/
What is correct about /proc/
All changes to files in /proc/ are immediately recognized by the kernel.
command must be entered before exiting vi to save the current file as filea.txt?
:w filea.txt
following signals is sent to a process when the key combination Ctrl+C is pressed on the keyboard?
SIGINT
command displays the output of the foo command on the screen and also writes it to a file called /tmp/foodata?
foo | tee /tmp/foodata
What output will be displayed when the user fred executes the following command? echo ˜fred $USER
fred fred
Which of the following commands displays the path to the executable file that would be executed when the command foo is invoked?
lsattr foo
When redirecting the output of find to the xargs command, what option to find is useful if the filenames contain spaces?
-print0
changes quota for specific user
edquota
Which top leve system directory is used for files and data that change regularly while the system is running and are to be kept between reboots
/var
commands can be used to determine how long the system has been running
uptime
top
What is true regarding the command
ls > files
if files does not exist?
files is created and contains the output of ls
Which of the following files, located in a user home directory, contains the Bash history?
.bash_history
Bash env var defines in which file the user history is stored when exiting a Bash process
HISTFILE
wildcards will match the following filenames?
ttyS0 ttyS1 ttyS2
tty?[0-5]
tty[A-Z][012]
displays the contents of a gzip compressed tar archive?
tar ztf archive.tgz
following command prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file?
cut -d : -f 1,4 /etc/passwd
regular expressions represents a single upper-case letter?
[A-Z]
Which command is used to start another command with a given nice level?
nice
Given a log file loga.log with timestamps of the format DD/MM/YYYY:hh:mm:ss, which command filters out all log entries in the time period between 8:00 am and 8:59 am?
grep -E ‘:08[0-9]+:[0-9]+’loga.log
Instead of supplying an explicit device in /etc/fstab for mounting, what other options may be used to identify the intended partition?
LABEL
UUID
A yum repository can declare sets of related packages. Which yum command installs all packages belonging to the group admintools?
yum groupinstall admintools
FILL BLANK -
What directory contains configuration files for additional yum repositories? (Specify the full path to the directory.)
/etc/yum.conf
Which of the following commands installs the GRUB boot files into the currently active file systems and the boot loader into the first partition of the first disk?
grub-install /dev/sda
What option to the yum command will update the entire system
yum update
yum upgrade
files are found in the /boot/ file system?
Linux kernel images
systemd target and service units
Which file defines the network locations from where the Debian package manager downloads software packages?
/etc/apt/sources.list
When removing a package on a system using dpkg package management, which dpkg option ensures configuration files are removed as well?
–purge
Which of the following statements are correct when comparing Linux containers with traditional virtual machines (e.g. LXC vs. KVM)? (Choose three.)
Containers are a lightweight virtualization method where the kernel controls process isolation and resource management.
Fully virtualized machines can run any operating system for a specific hardware architecture within the virtual machine.
The guest environment for fully virtualized machines is created by a hypervisor which provides virtual and emulated hardware devices.
The installation of a local Debian package failed due to unsatisfied dependencies. Which of the following commands installs missing dependencies and completes the interrupted package installation?
apt-get install -f
Which of the following commands lists all currently installed packages when using RPM package management?
rpm –query –all
An admin has issued following cmd
grub-install –root-directory=/custom-grub /dev/sda
In which directory will new config files be found
/custom-grub/boot/grub/
commands are valid in the GRUB 2 configuration file?
menuentry
insmod
World-writeable directory should be placed on a separate partition in order to prevent users from being able to fill up the / filesystem
/var/tmp
tmp
purpose of the ldd command?
It lists which shared libraries a binary needs to run.eeds to run.
What can the Logical Volume Manager (LVM) be used for?
create snapshots
dynamically change the size of logical volumes
dynamically create or delete logical volumes
main differences between GPT and MBR partition tables regarding maximum number and size of partitions?
GPT - By Default
128 Partitions
Partition sizes of 9.4 ZB (1 billion terrabytes)
MBR - by default
4 Partitions
partition size of 2.2 TB
A backup software heavily uses hard links between files which have not been changed in between two backup runs. Which benefits are realized due to these hard links? (Choose two.)
The old backups can be moved to slow backup media, such as tapes, while still serving as hard link target in new backups.
The backup consumes less space because the hard links point to the same data on disk instead of storing redundant copies.
FILL BLANK -
Which file from the /proc/ file system contains a list of all currently mounted devices? (Specify the full name of the file, including path.)
/proc/mounts
How many fields are in a syntactically correct line of /etc/fstab?
6
Running chmod 640 filea.txt as a regular user doesnt update filea.txts permission. What might be a reason why chmod cannot modify the permissions?
filea.txt is owned by another user and a regular user cannot change the permissions of another user’s file.
filea.txt is a symbolic link whose permissions are a fixed value which cannot be charged.
After modifying GNU GRUB’s config files what command must be run for changes to take effect?
No actions required.
What is the difference between the –remove and the –purge action with the dpkg command
–remove - removes the program
–purge - removes the config files
Which of the following Linux filesystems preallocate a fixed number of inodes when creating a new filesystem instead of generating them as needed? (Choose two.)
ext3
ext2
Which of the following commands sets the SetUID permission on the executable /bin/foo?
chmod 4755 /bin/foo
commands to set the sticky bit for directory /tmp
chmod +t /tmp
chmod 1775 /tmp
Command makes /bin/foo executable by everyone but writable only by its owner
chmod u=rwx,go=rx /bin/foo
Which of the following commands can be used to display the inode number of a given file? (Choose two.)
ls
stat
settings for umask ensures that new files have the default permissions -rw-r—–?
0027
permissions -rwSr-xr-x mean for a binary file when it is executed as a command
The execute flag is not set for the owner. Therefore the SetUID flag is ignored.
Which command will display messages from the kernel that were output during the normal boot sequence?
dmesg
/bin/dmesg
After a power outage, the XFS file system of /dev/sda3 is inconsistent. How can the existing file system errors be fixed?
By running xfs_repair on the file system
What command overwrites the bootloader located on /dev/sda without overwriting the partition table or any data following it
dd if=/dev/zero of=/dev/sda bs=440 count=1
command can be used to create a new file that is 100kB in size
dd
used to locate programs and their corresponding man pages and config files
wheris
device file name for second partition on the only SCSI drive
/dev/sda2
Which of the following properties of an existing file changes when a hard link pointing to that file is created?
link count
FILL BLANK -
Following the Filesystem Hierarchy Standard (FHS), where should binaries that have been compiled by the system administrator be placed in order to be made available to all users on the system? (Specify the full path to the directory.)
/usr/local/bin/
Which of the following commands show how the shell handles a specific command?
type
When in Normal mode in vi, which character can be used to begin a reverse search of the text?
?
Regular expression that can be used for the beginning of a line
commands displays the manual page command from section 1?
man 1 command
commands creates or, in case it already exists, overwrites a file called data with the output of ls?
ls > data
commands is used to change options and positional parameters within a running Bash shell?
set
commands display the IDs of all processes owned by root?
pgrep -u root
pgrep -U 0
Which of the following sequences in the vi editor saves the opened document and exits the editor?
Esc :wq
Esc ZZ
effect of the -v option for the egrep command?
It only outputs non-matching lines
show the complete path of an executable file that the current shell would execute when starting a command without specifying its complete path?
which
type
signals is sent to a process when the key combination Ctrl+Z is pressed on the keyboard
SIGSTOP
What is the output when the regular expression s/[ABC] [abc]/xx/ is applied to the following string?
ABCabc -
xxxxxx
print the current working directory when using a Bash shell?
echo ${PWD}
pwd
cmd used to download RPM package kernel without installing it
yumdownloader kernel
outputs test to the shell?
cat «EOT test EOT
What is the default nice level when a process is started using the nice command?
10
A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remove that directory?
rmdir ~/\dir
can perform searches on file contents using regular expressions?
grep
In a nested directory structure, which find command line option would be used to restrict the command to searching down a particular number of subdirectories
-maxdepth
determine a files format by using a definition dbase file that contains info about all common file types
file
generates a list of user names from /etc/passwd along with their login shell?
cut -d: -f1,7 /etc/passwd
If the gzip compressed tar archive texts.tgz contains the files a.txt and b.txt, which files will be present in the current directory after running gunzip texts.tgz?
Only texts.tar and texts.tgz
In the vi editor, how can commands such as moving the cursor or copying lines into the buffer be issued multiple times or applied to multiple rows?
By specifying the number right in front of a command such as 41 or 2yj.
Which of the following statements is correct for a command ending with an & character?
The command is run in background of the current shell.
reads a file and creates separate chunks of a given size from the file contents?
split
What is the purpose of the xargs command?
It reads standard input (STDIN) and builds up command lines to execute.
Which command displays a list of all background tasks running in the current shell?
jobs
Which command is used to change the priority of an already running process?
renice
standard output to standard error.
ls >&2
Init systems used with Linux
systemd
Upstart
SysV init
When booting from the hard disk, a computer successfully loads the Linux kernel and initramfs but hangs during the subsequent startup tasks. The system is booted using a Linux based rescue CD to investigate the problem. Which of the following methods helps to identify the root cause of the problem?
Investigating the file /var/log on the computers hard disk for possible errors.
Where is the bootloader stored on the hard disk of a UEFI system?
On the EFI System Partition (ESP).
What is true regarding UEFI firmware
It can use and read certain file systems
It is stored in a special area within the GPT metatada
examples for Bash file globbing matches a file named root-can-do-this.txt when used in the directory holding that file
root*can?do-this.{txt,odt}
r[oOoO]t-can-do*.txt
{root,user,admin}-can-??-this.txt
What statements are correct about the initial RAM disk involved in the boot process of Linux?
An initramfs is a compressed file system archive, which can be unpacked to examine its contents.
After a successful boot, the initramfs contents are available in /run/initramfs/.
commands loads a kernel module along with any required dependency modules?
modprobe
kernel command line changes the systemd boot target to resue.target instead of default target.
systemd.unit=rescue.target
The USB defice filesystem can be found under /proc/____/usb/
bus
You suspect that a new eithernet card by be conflicting with another device. Which file should you check within the /proc tree to learn which IRQs are being used by which kernel drivers
interrupts
/proc/interrupts
What information can the lspci command display about the system hardware?
Device IRQ settings
PCI bus speed
Device vendor identification
Which System V init configuration file is commonly used to set the default run level?
/etc/inittab
Which run levels should never be declared as the default run level when using SysV init?
0 and 6
You are having some trouble with a disk partition and you need to do maintenance on this partition but your users home directories are on it and several are logged in. What command would disconnect users and allow you to safely execute maintenance tasks.
init 1
telinit 1
command instructs SysVinit to reload its config file
telinit q
Given the following two symbolic links in a System V init configuration:
/etc/rc1.d/K01apache2
/etc/rc2.d/S02apache2
When are the scripts executed that are referenced by these links?
S02apache2 is run when runlevel 2 is entered.
K01apache2 is never run because K indicates a deactivated service.
what command will write a message to the terminals of all logged in users.
wall
Which SysV init comfig file should be modified to disable the ctrl-alt-del key
/etc/inittab
The message “Hard Disk Error” is displayed on the screen during Stage 1 of the GRUB boot process - what does this inidicate.
The next Stage cannot be read from the hard disk because GRUB was unable to determine the size and geometry of the disk.
Which command will disable swapping on a device
swapoff
sbin/swapoff
what does mount -a do
ensures all file systems listed with option auto in /etc/fstab are mounted.
option in GRUB Legacy config file to define the amount of time that GRUB menu will be shown to user
timeout
Signal sent by the kill command by default
SIGTERM (15)
To what env var will you assign or append a value if you need to tell the dynamic linker in a build directory for some of a program’s shared libraries
LD_LIBRARY_PATH
shell command makes already defined TEST visible to new child processes
export TEST
RPM command outputs name of the package that supplied /etc/exports?
/etc/exports
Env var overrides or extends the list of directories holding shared libraries.
LD_LIBRARY_PATH
What command displays the current disk space usage for all mounted file systems
du
When using rpm –verify to check files created during the install of RPM package what is taken into consideration
Timestamps
MD5 Checksums
File sizes
file in users home directory contains Bash history
.bash_histfile
commands redirects the output of ls to standard error?
ls >&2
command changes all CR-LF line breaks in the text file userlist.txt to Linux standard LF line breaks and stores the result in newlist.txt?
tr -d ‘\r’ < userlist.txt > newlist.txt
Which command uninstalls a package but keeps its config files in case the package is re-installed
dpkg -r pkgname
apt-get subcommand installs the newest versions of all currently installed packages
update
Which of the following are valid stream redirection operators with Bash
<
2>&1
When redirecting the output of find to the xargs command, what option to find is useful if the filenames contain spaces
-print0
Which of the following commands installs GRUB 2 into the master boot record on the third hard disk
grub-install /dev/sdc
in bash inserting 2>&1 after a command redirects
standard output to standard error
which type of filesystem is created by mkfs when it is executed with the block device name only and without any additional parameters.
ex2
Where does the BIOS search for a bootloader?
On all connected storage media in the defined boot device order.
What is the purpose of the Filesystem Hierarchy Standard
It is a distribution neutral description of locations of files and directroies.
Which of the following commands converts spaces in a file to tab characters and prints the result to standard output
unexpand