LPI 101-500 LPIC-1 Linux Administrator Exam Flashcards
what file in the users home directory contains Bash history
.bash_histfile
a debian package creates several files during its installation. What command searches for packages owning /etc/debian_version?
find /etc/debian_version -dpkg
what expression represents a single upper-case letter
[A-Z]
the command dbmaint was used to run in the background. However, dbmaint is terminated after logging out of the system. What alt dbmaint invocation lets it continue to run even when the user running the program logs out
bg dbmaint
what umask value ensures that new directories can be read, written and listed by their owning user, read and listed by their owning group and not accessible at all for everyone else.
0027
yum repository configs can include these
$basearch or $releasever
in case /etc/yum.repos.d contains files, /etc/yum.conf is ignored
if /etc/yum_repose.d contains files then this file will be ignored
/etc/yum_conf
Wildcard characters will match following file names
ttyS0
ttyS1
ttyS2
tty?[0-5]
tty[A-Z][012]
what is a valid reason to not use hard links
because they are not available on all linux systems and filesystems like ext4 do not support them
vi command deletes two lines, the current and following line
2dd
command list all files and directories within the /tmp/ directory and its subdirs that are owned by root user
find /tmp -user root -print
find -path /tmp -user root -print
this can use and read certain file systems and is stored in a special area within the GPT metadata
UEFI firmware
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
command redirects the output of ls to standard error
ls > &2
what should be changed when a linux vm is cloned
permissions of /root/
SSH host keys
what command changes all CR-LF line breaks in the text file userlist.txt to Lunux standard LF breaks and stores the result in lewlist.txt
tr -d ‘\r’ < userlist.txt > newlist.txt
given the following input stream
txt1.txt
atx.txt
txB.txt
what regular expression turns this input stream into the following output
tx1.bak.txt
atxt.bak.txt
txB.bak.txt
s/txt/bak.txt/
command displays the path to the executable file that would be executed when the command foo is invoked?
lsattr foo
considering this directory
drwxrwxr-x 2 root sales 4096 Jan 1 15:21 sales
what command ensures that files created wihin the directory sales are owned by the group sales
chgrp -p sales sales
chmod 2775 sales
daemon that handles power management events on linux system
acpid
default % of reserve space for root user on new ext4 filesystems
5%
what does the mount –bind do
makes contents of one directory available in another directory
command uninstalls a package but keeps its config in case the package is reinstalled
dpkg -r pkgname
command displays the current disk space usage for all mounted file systems
du
apt-get subcommand installs the newest version of all currently installed packages
update
lists dependencies of the RPM package file foo.rpm
rpm -qpR foo.rpm
valid stream redirection operators in Bash
<
2>&1
first program the linux kernel starts at boot time when using System V init
/sbin/init
when redirecting the output of find to the xargs command, what option to find is useful if the filenames contain spaces
-print0
when is content of kernel ring buffer reset
using dmesg –clear
when system is shut down or rebooted
what is contained on the EFI System Partition
first stage boot loader
what is true about this command
ls > files
if it does not exist
the file is created and contains the output of ls
file loga.log with timestaps of format DD/MM/YYY:hh:mm:ss
what 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
what happens in boot sequence of PC using BIOS
some parts of the boot proccess can be configured from the BIOS and the BIOS initiates the boot process after turning the computer on
program runs a command in specific intervals and refreshes the display of the program’s output
watch
command must be entered before exiting vi to save the files as filea.txt
:w filea.txt
directories on 64 bit linux system typically contain shared libs
~/.lib64/
/lib64/
true when a file system that is neither listed in /etc/fstab nor known to system is mounted manually
cmd systemctl mountsnc can be used to create a mount unit based on the existing mount
command prints list of usernames (first column) and their primary group (fourth column) from /etc/passwd file
cut -d :-f 1,4 /etc/passwd
cmd installs all packages with a name ending with the string foo
zypper install “*foo”
cmd installs GRUB 2 into MBR on third hard disk
grub-install /dev/sdc
a faulty kernel module is causing issues with a nic so what action ensures that the module is not loaded automatically when the system boots
adding a black line including the name of the offending module to the file
/etc/modprobe.d/blacklist.conf
exists in standard GRUB 2 install
/boot/grub/i386-pc/1vm.mod
/boot/grub/grub.cfg
output displayed when user fred exececutes echo fred $USER
fred fred
cmd ls -i
how would new file named c.txt be created with same inode number as a .txt (Inode 525385)
ln a.txt c.txt
in bash inserting 2>&1 after a command redirects
standard output to standard error
filesystem created by mkfs when it is executed with the block device name only and without any additional parameters
ex2
after moving data to new filesystem how can the former path of the data be kept intact in order to avoid reconfig of existing apps
by create symbolic link from old to new path of data and by mounting new filesystem on the original path of the data
cmd used to display inode number of given file
ls
this system config file is commonly used to set default runlevel
/etc/inittab
cmd enables setuid (suid) permission on the executable /bin/foo
chmod 4755 /bin/foo
command reads standard input (STDIN) and builds up command lines to execute
xargs
where does BIOS search for bootloader
on all connected storage media in the defined boot device order
purpose of the Filesystem Hierarchy Standard
FHS
it is a distribution neutral description of locations of files and directories
pressin Ctrl-C combination on the kb while cmd is executing in the foreground send this signal
2(SIGINT)
modes of VI editor
insert mode
command mode
cmd uninstall a package but leave its config files in case the pkg is re-installed
dpkg -r pkgname
permission and ownership of the file /etc/passwd
-rw-r–r–1 rootroot531 Jun 5 22:45 /etc/passwd
cmd makes /bin/foo executable by everyone but writeable only by its owner
chmod u=rwx,go=rx /bin/foo
when using regular expressions what character match beginning of a line
cmd changes nice level of running process
renice
cmd used to locate programs and their corresponding man pages and config files
whereis
device file name for second partition on the only SCSI drive
/dev/sda2
cmd instructs SysVinit to reload its config file
telinit q
program updates database used by locate command
updatedb
default signal send by kill cmd
SIGTERM(15)
cmd line creates on incase it already exists, overwrites a file called data with the output of ls
ls > data
utility would be used to chang how often a filesystem check is performed on an ext2 filesystem without losing any data stored on that filesystem
tune2fs
cmd changes the number of days before ext3 filesystem on /dev/sda1 has to run through a full filesystem check while booting
tune2fs -i 200 /dev/sda1
cmd converts spaces in file to tab characters and prints the result to standard output
unexpand
file from /proc file system contains list of all currently mounted devices
mounts
cmd line ending with a & character
the command is run in background of the current shell
apt-get cmd will install newest version of all currently installed packages
dist-upgrade
settings for umask ensures that new files have the default permissions
rw-r—–
0027
shell commands makes already defined var TEST visible to new child processes
export TEST
set sticky bit for the directory /tmp
chmod +t /tmp
chmod 1775 /tmp
GRUB install all required files and configures the boot loader on device/dev/sda
grub-install /dev/sda
cmd changes metadata and option for ext3 filesystem
tune2fs
how many fields are in a sytactically correct line of /etc/fstab
6
why does creating a hard link to an ordinary file return an error
the source and target are on different filesystems
cmd updates already installed RPM package rpmname
rpm -U rpmname
file in /proc describes IRQs that are used by various kernel drivers
interrupts
how is symbolic link called bar.conf pointing to foo.conf created
ln -s foo.conf bar.conf
correct order in which the components of system boot process are started
BIOS, bootloader, kernel, init system
what do permissions -rwSr-xr-x mean for a binary file when it is executed as a command
the command will be executed with the effective rights of the owner and group
ensures all file systems listed with the option auto in /etc/fstab are mounted
mount -a
cmd loads a kernel module along with any required dependency modules
modprobe
when piping output of find to the xargs command what option to find is useful if the filenames have spaces in them
-print0
cmd will change quota for specific user
edquota
cmd changes all occurrences of word “bob” in a file data to “Bob” and prints the result to standard output
sed ‘s/b0b/Bob/g’ data
filesystems used on linux root partitions
ext3
swap
limitation of cut cmd
it cannot reorder fields
permissions belong to symbolic link
lrwxrwxrwz
option of the tee cmd will cause the output to be contatenated on the end of the output file instead of overwriting the existing file contents
-a
cmd creates a swap space on a block device or file
mkswap
cmd reads and displays the current contents of the Kernel Ring Buffer on the cmd line
dmesg
cmd prints a list of available package updates when using RPM-based package management
dpkg check-update