Flashcards in lpic Deck (59):
Which bash configuration files are used for non-login bash shell sessions?
/etc/bashrc & ~/.bashrc
which bash config files are used for login shell sessions?
/etc/profile, ~/.profile, ~/.bash_profile
name two ways to get more info on a command
man & info
how to switch into insert mode in VI?
press I key or Insert button
how do you quit vi without without savings changes?
How do you create a directory in user's home named MyFiles
which command can bused to display information about your linux kernel such as version number and release number?
which vi command line mode commands save changes to the current file being edited and close the vi editor
:wq & :exit
change widgets.odt so that the file owner can edit the file, but no other users on the system will be able to modify it.
chmod 600 widgets.odt
change permission on projectx.odt so that owner can edit the file and group members can view and edit
chmod 660 widgets.odt
which usermod command is used to add a secondary group to user account
which control structure processes over and over as long as a specified condition evaluates to false?
which control structure runs over and over until a specified condition is no longer true.
which services should be used for file sharing and print jobs?
samba for file CUPS for printing
logged in via GNOME graphical desktop env. You've opened a terminal session within GNOME to complete several command-line tasks. which bash config files were used to configure the bash env within the shell session
/etc/bashrc & ~/.bashrc
which file will be used by default for bash login shells?
~/.bash_profile, ~/.bash_login, ~/.profile.file in that order.
Which configuration files are used to store your X server configuration settings?
/etc/X11/XF86Config & /etc/X11/xorg.conf
When using local auth on a Linux system, which file contains the passwords for your user accounts
whats stored in /etc/passwd
kmorgan:x:1001:100:Ken Morgan:/home/kmorgan:/bin/bash What is the user ID (UID)?
kmorgan:$2a$05 $KL1DbTBqpSEMiL.2FoI3ue4bdyR.eL6GMKs7MU6.nZl5SCC7/ REUS:15043:1:60:7:5:: In how many days will this account be disabled after the users password has expired?
5. the seventh field displays the number of days to wait after a password expired to disable the account.
kmorgan:$2a$05 $KL1DbTBqpSEMiL.2FoI3ue4bdyR.eL6GMKs7MU6.nZl5SCC7/ REUS:15043:1:60:7:5:: How many days prior to expiration will user be notified?
Where is the UID number range that can be assigned to new user accounts defined
You need to create a new user account for a user named Kimberly Sanders on your Linux system. You want to specify a username of ksanders, a full name of Kimberly Sanders, a default shell of /bin/bash, and that a home directory be created. Which command will do this?
useradd –c "Kimberly Sanders" –m –s "/bin/bash" ksanders
The stracy user has recently married and changed her last name to Marsden. Which
command can be used to update her user account with her new last name?
usermod –l smarsden –c "Sandy Marsden " stracy
You need to add the aebbert user to the secondary dbusers group. Which command can
be used to do this?
usermod –aG dbusers aebbert
You’re writing a script that will require the end user to enter the name of his or her supervisor.
Which of the following lines will input the user’s response into a variable named SUP?
You’ve just created a new script in your home directory named runme.sh. When you try to run your script while in your home directory using the ./runme.sh command from the shell prompt, you see the following error: bash: ./runme.sh: Permission denied. Which resolution will fix this issue?
Enter chmod u+x runme.sh at the shell prompt.
You need to assign a numeric value to a variable named TOT in a script so that you can perform mathematical operations on it. Which line can you add to your script to do this?
declare –i TOT
You need to write an if/then/else statement in a script that will test to see if a file named /var/opt/mydb/mydb exists and has the write permission assigned for the user running the script. Which statement will do this?
if test –w /var/opt/mydb/mydb; then...
You need to write an if/then/else statement in a script that will test to see if a file named /var/opt/mydb/mydb exists and is a regular file. Which statement will do this?
if test –f /var/opt/mydb/mydb; then...
You need to implement a for loop in a script. You want to use the seq command to generate a sequence of numbers that starts at 1, increments by 1, and stops at 100. Which statements will do this? (Choose two.)
for i in `seq 100` & for i in `seq 1 1 100`
Which protocols operate at the Network layer of the OSI model? (Choose two.)
IP & ICMP
B. 172.17.8.1 C. 10.254.254.1 D. 18.104.22.168 E. 22.214.171.124
Which IP addresses are private addresses?
B. 172.17.8.1 C. 10.254.254.1
Consider the following IP address: 172.17.8.10/22. Which subnet mask is assigned to this address?
A. 255.255.252.0 B. 255.255.0.0 C. 255.255.255.0
You need to assign the ens32 interface an IP address of 172.17.8.1 with a subnet mask of
255.255.0.0 and a broadcast address of 172.17.255.255. Which command will do this?
D. ifconfig ens32 172.17.8.1 netmask 255.255.0.0 broadcast 172.17.255.255
Which directive in /etc/sysconfig/network/ifcfg-eth0 is used to specify whether the
interface is automatically enabled when the system is booted?
One of your Linux workstations has been configured with an incorrect default gateway
router address. Which file do you need to edit to correct this?
For security reasons, you want your Linux system to always try to resolve hostnames using your DNS server before trying to resolve them using the /etc/hosts file. Which file can you use to configure the name resolver order?
What is /etc/resolv.conf used for
it is used to configure the IP address of the DNS server but doesn’t configure the name service order.
The /etc/sudoers file on your Linux system is configured by default such that users must supply the root password when using sudo. You want to change this such that they only must supply their own password to use sudo. Which directives in the /etc/sudoers file must be commented out to do this? (Choose two.)
ALL ALL=(ALL) ALL
Which syslog facility can be used to capture log messages from an application you programmed yourself?
authpriv facility is used for what?
all services associated with system security
To secure the sshd service running on your Linux system from hackers, you decide to configure it to listen for SSH requests on a port other than the default of 22. Which directive in your etc/ssh/sshd_config file can you use to do this?
BindAddress directive is used for
specify the address on the local machine to be used as the source address of the connection
You want to write the stdout from the ps command to a file named myprocesses in the /tmp directory without overwriting the existing contents of that file. Which command will do this?
ps 1 >> /tmp/myprocesses
Which Linux runlevel puts the system in multiuser mode with networking enabled and a command-line interface?
Runlevel 3 puts Linux in multiuser mode with networking enabled. The command-line interface is used.
command-line interface but puts the system in single-user mode.
command-line interface and runs in multiuser mode; however, it also disables networking.
Linux in multiuser mode with networking enabled and a graphical user interface.
You need to configure the GRUB2 bootloader such that it will boot the first operating system in the boot menu by default unless the end user manually selects an operating system within the timeout period. Which directive should you add to the /etc/default/ grub configuration file to do this?
What happens if GRUB_SAVED DEFAULT is set to true?
GRUB_SAVED DEFAULT to true, then GRUB will automatically select the last selected operating system from the menu as the default operating system to be used on the next boot. This parameter could conflict with the GRUB_DEFAULT parameter. Therefore, you can use either one, but not both.
What does GRUB_HIDDEN-TIMEOUT_QUIET do?
GRUB_HIDDEN_TIMEOUT_QUIET=true directive causes no countdown timer to be displayed.
Your Linux distribution uses systemd. It is currently running in a graphical environment. You want to switch to a multiuser text-based environment. Which commands could you use to do this? (Choose two.)
systemctl isolate runlevel3.target systemclt isolate multi-user.target
You just added a third SATA hard disk drive to your Linux system and need to create a GPT partition on it. Which command should you use to do this?
You are implementing an LVM volume on a Linux system with 16GB of RAM. You’ve added two SATA hard disks (/dev/sdb and /dev/sdc) to the system and created a partition on each one. You also defined both of these partitions as LVM physical volumes. Now you need to add both physical volumes to a new volume group named DATA. Which command should you use?
vgcreate DATA /dev/sdb1 /dev/sdc1
Your Linux distribution currently uses the LightDM display manager with the Unity greeter. You want to reconfigure it to use the Qt greeter. Which parameter must you change in the LightDM configuration to do this?
which greeter LightDM uses by creating the appropriate file in /etc/lightdm/lightdm.conf.d/ and using greeter-session=file_name to specify the name of a greeter file (which has a .desktop extension) that you want to use in /usr/ share/xgreeters.
You installed a new Linux system about a week ago. Three days ago, you compiled and installed a new application from source code. Now, the Ethernet interface in the system sporadically goes offline. You need to see the boot messages generated by the system when it was in a pristine state shortly after being installed. Given that your system uses systemd instead of the init daemon, which command should you use?
journalctl –b 2