You are on page 1of 56

102. Partitions Q. How can be accessed the Swap partition.

a)/swap
b)/etc/swap
c) /usr/bin
d) /usr/sbin
e) it can’t be accessed
A. e) it can’t be accessed. If the system needs more resources, inactive
pages of your memory are moved to the swap partition to free up
more memory to work with, and there is no _/_ because it can’t be
accessed by the user like a normal file system.
102.Partitions Q.What is LVM
A.Logical Volume Manager, split disk into pools and then combine
those pools in partitions. Can grow and shrink partitions.
102.Partitions Q.What is a Boot loader? Example of boot loaders?
A. Enables you to boot a Linux system. It runs before the operating
system but can be configure also from the operating system.
A boot loader, also called a boot manager, is a small program that
places the operating system (OS) of a computer into memory. When a
computer is powered-up or restarted, the basic input/output system
(BIOS) performs some initial tests, and then transfers control to
the master boot record (MBR or uses UEFi system) where the boot
loader resides.
One of the first boot loaders was called LILO which stands for
Linux loader, and the GRUB (Grand Unified Bootloader) from the GNU
Project which has 2 versions: Grub Legacy and Grub 2 (the latest
release).
102.GRUB Q. Where can grub directory can be found?
a) /boot
b) /etc/boot
c) /bin
d) /home
A. Because it is the boot loader it can be found in /boot (a)
102.GRUB Q. What is the main configuration file for Grub?
a) grub.cfg for most recent version of Grub and menu.lst or
grub.conf for older versions
b) grub.lst
c) grub.conf for recent versions and grub.conf for older versions
d) menu.lst for recent versions and grub.conf or grub.cfg for
older versions

A. a) grub.cfg and it is located in /boot/Grub/grub.cfg


102.GRUB Q.How is generated the config file for grub (by grub-
mkconfig command) (grub.cfg or grub.conf or menu.lst; don’t want
to give hints for the previous question)
a) using templates from /etc/grub.d and settings from
/etc/default/grub
b) using settings from /etc/grub.d and templates from
/etc/default/grub
c)using scripts from /etc/default/grub
d)using scripts from /etc/grub.d

A. a)this info is written on the beginning of the config file (from the
previuos question)
102.GRUB Q.What option need to be changed to be able to modify
the time until the OP starts at the beginning of the booting system, in
the default config file? The default param is set to 2 sec.
a)GRUB_DEFAULT

b) GRUB_TIMEOUT

c)GRUB_CMDLINE_LINUX_DEFAULT

d)GRUB_CMDLINE_LINUX

A. b) GRUB_TIMEOUT in /etc/default/grub
102.GRUB Q.What we need to run after updating the config file
(default config file found in /etc/default/) for Grub, for the
changes to take effect.
a) update the new setting with _update-grub_ command

b) rebooting the system with _init 6_ command

c) rebooting the system with _init 0_ command

d) just saving the file before exit and the new settings are taken into

consideration

A. a) update the file by running update-grub_ which runs the grub-


mkconf command wich updates the main config file grub.cfg. After this
the updates are taken in consideration
102.GRUB Q.What we need to run after updating the config
file( found in /boot/grub/) for Grub, for the changes to take effect.
a)update the new setting with _update-grub_ command
b)rebooting the system with _init 6_ command
c) just saving the file before exit and the new settings are taken into
consideration
d)nothing, the changes are saved and can be seen at the next update

A.d) the config file found in /boot/grub is made up of two files,


template files found in /etc/grub.d and settings found in
/etc/default/grub. When a settings parameter modified in
/etc/default/grub is changed , it is imperative to run update-grub
command so the change are written to /boot/grub, so after that file
is updated we don’t have to execute nothing else.

102.GRUB Q. What key need to press to enter in safe mode (rescue


mode) on boot?
a) left shift

b) right shift

c) delete

d) arrow keys and choose from the menu rescue mode

A. a)
102.GRUB Q. How can you see the GRUB version?
a) grub-version -V or grub-V

b) grub-check –version(-V)

c) grub-probe –iv or grub –version(V)

d) grub-install –version(-V) or grub-probe –version(-V)

A. d)
102.Libraries Q. Where are the locations of shared libraries stored
on your file system, how the Ubuntu keeps track of them?
a) /etc/ld.so.conf

b) /var/ld.so.conf

c) /etc/ldd/ld.so.conf

d) /usr/ldd
A. a)in /etc/ld.so.conf it is included /etc/ld.so.conf.d that
has all the libraries. But there is just info about them not the real files
of the lib.
For example: in Ubuntu Desktop in /etc/ld.so.conf.d we have
libc.conf and x86_64-linux-gnu.conf and if we open further
libc.conf ( standard C library ) we find out that the real file is in
/usr/local/lib, and there we find the python.
In centos we have mariaDB (instead of libc.conf) and other cpu
architecture lib .
The question may mislead, and it is important to understand the
difference between the real file(library) and the way the system is
aware of it.
102.Libraries Q. How to add a shared library to the dynamic linker?
A. Make the configuration file and place it in the /etc/ld.so.conf.d
directories with other configuration files. Then in that file
include the libraries you want from /home/usr/bin. After that is
very important to update the Dynamic linker with ldconfig
command for the changes to take effect.
B. Another way is to use environmental variables. We can use a
temporary variables that will no longer exists at logout.
Export LD_LIBRARY_PATH=my file path
To query the shell and see what the path is set to
echo $LD_LIBRARY_PATH.
102.Dependecies
Q. Find out which are the dependencies for ls app?
A)
step1) run which ls to find out where this app is located
step2) run ldd _path_ to the app discovered at the previous step
ldd = list all dependecies

102.Package mangers Q. What dpkg and apt mean ? What is the


difference between them.
A. Debian Package Manager and Advanced Package Manager.
Apt installs also the dependencies automatically.
102. Package managers Q. What is the use of wget command?
A. The wget utility allows you to download web pages, files and images
from the web using the Linux command line.
You can use a single wget command on its own to download
from a site or set up an input file to download multiple files across
multiple sites.
According to the manual page wget can be used even when the
user has logged out of the system. To do this you would use the nohup
command.
The wget utility will retry a download even when the
connection drops, resuming from where it left off if possible when the
connection returns.
You can download entire web sites using wget and convert the
links to point to local sources so that you can view a website offline.

102. Package managers Q. What command needs to be run to be able


to install a .deb file?
a) dkpg -i

b) dpkg -i

c) dkgp -i

d) dkpk -i
b)dpkg -i

debian package install

The entire command is

sudo dkpg -i filename.deb.

The question refers obviously to dpkg and not to apt as a package

manager
102. Package managers Q. What command needs to be run to be able
to remove an installed package.
a) dpkg --del filename

b) dkpg –-rm filename

c) dkgp --purge filename

d) dkpk –del -rm filename


c) dpkg --purge filename
102.Package managers Q.How do you update the apt package sources?
a) apt-get upgrade

b) apt-get update

c) apt-get dist-upgrade

d) apt-get dist-update
a)apt-get update if we use apt-get dist-upgrade it will take care also the
dependencies.
102.Package managers Q. What does the apt-get remove
filename command?
a) removes the app, but keeps the configuration file and all the
dependencies that needs to be removed in another step.
b) removes the app, configuration file and also the dependencies
installed
c) removes the app and the configuration file but keeps the
dependencies
d) removes the app and the dependencies but keeps the configuration
file.
a) Removes only the app. The configuration needs to be removed
with sudo dbpk –purge filename and the dependencies
with sudo apt-get autoremove.
102. P.Man Q.What command needs to be run to see the
dependencies of apache2?
a) apt-cache apache2 | less

b) apt-cache depends apache2 | less

c) apt-get cache depends apache2 | less

d) apt-get depends apache2 | less


b)apt-cache depends apache2 | less
102. P.Man Q. On which Linux distro it is most likely to have RPM –
YUM as package managers?
a) Linux Mint and Ubuntu

b) Red Hat, Centos and Linux Mint

c) Fedora, Centos and Ubuntu

d) Red Hat, Centos, Fedora


A. d) RPM-Red Hat Package Manager, which was developed by Red Hat
and Yellowdog Updater Modified (YUM) ( replaces YUP, Yellowdog
Updater ) which was originally developed to manage Red Hat Linux
systems at Duke University's Physics department are package managers
that is likely to to be found on d) Red Hat, Centos, Fedora.
102. P.Man Q. On which Linux distro it is most likely to have dpkg –
apt as package managers?
a) Linux Mint and Ubuntu

b) Red Hat, Centos and Linux Mint

c) Fedora, Centos and Ubuntu

d) Red Hat, Centos, Fedora


a)Linux Mint and Ubuntu
dpkg stands for Debian Package Manager, and it is used for install,
upgrade, remove software. It is the low level tool.
apt = Advanced Package Tool, it has extra as compared with dpkg the
functionality of installing the dependencies for that package and can
upgrade the entire system. It uses the online repositories for the
dependencies.
102. P.Man Q.Which command will query for the yum package a file
belongs to, or was installed by?
a) yum -qf filename
b) apt -qf filename
c) dpkg -qf filename
d) rpm -qf filename
d) rpm -qf filename
102. P.Man Q. Where are yum repositories defined?
a) In a file called /etc/yum.repos.conf
b) In a file called /etc/yum.repos.d
c) In a directory called /etc/yum.repos.conf
d) In a directory called /etc/yum.repos.d
d) In a directory called /etc/yum.repos.d
102. P.Man Q. How do you update your yum package sources?
a) yum update
b) yum get
c) yum upgrade
d) yum download
a) yum update
102. P.Man Q. How to check if every files that belongs to a package
exists?
a) rpm --verify filename
b) yum --verify filename
c) rpm --check filename
d) yum --cache filename
a) rpm --verify filename
and use
rpm -Va
to check the entire sytem.
Symbols meaning in verify :
5 - digest(formerly md5 num) differs
T - mTime differs (last modified)
S - file size differs
102. P.Man Q. How to remove a package?
a) yum remove filename
b) yum --rm filename
c) rpm --del filename
d) yum --d rm filename
a)yum remove filename. Usually with yum only install , delete and
other big operations , and more detailed commands are done with
rpm.

You might also like