lpic Flashcards

1
Q

Which bash configuration files are used for non-login bash shell sessions?

A

/etc/bashrc & ~/.bashrc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

which bash config files are used for login shell sessions?

A

/etc/profile, ~/.profile, ~/.bash_profile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

name two ways to get more info on a command

A

man & info

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how to switch into insert mode in VI?

A

press I key or Insert button

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how do you quit vi without without savings changes?

A

:q!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you create a directory in user’s home named MyFiles

A

mkdir ~/MyFiles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

which command can bused to display information about your linux kernel such as version number and release number?

A

uname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

which vi command line mode commands save changes to the current file being edited and close the vi editor

A

:wq & :exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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.

A

chmod 600 widgets.odt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

change permission on projectx.odt so that owner can edit the file and group members can view and edit

A

chmod 660 widgets.odt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

which usermod command is used to add a secondary group to user account

A

-aG

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

which control structure processes over and over as long as a specified condition evaluates to false?

A

until

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

which control structure runs over and over until a specified condition is no longer true.

A

while

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

which services should be used for file sharing and print jobs?

A

samba for file CUPS for printing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

/etc/bashrc & ~/.bashrc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

which file will be used by default for bash login shells?

A

~/.bash_profile, ~/.bash_login, ~/.profile.file in that order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which configuration files are used to store your X server configuration settings?

A

/etc/X11/XF86Config & /etc/X11/xorg.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

When using local auth on a Linux system, which file contains the passwords for your user accounts

A

/etc/shadow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

whats stored in /etc/passwd

A

user accounts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

kmorgan:x:1001:100:Ken Morgan:/home/kmorgan:/bin/bash What is the user ID (UID)?

A

1001

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

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?

A
  1. the seventh field displays the number of days to wait after a password expired to disable the account.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

kmorgan:$2a$05 $KL1DbTBqpSEMiL.2FoI3ue4bdyR.eL6GMKs7MU6.nZl5SCC7/ REUS:15043:1:60:7:5:: How many days prior to expiration will user be notified?

A

7.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Where is the UID number range that can be assigned to new user accounts defined

A

/etc/login.defs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

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?

A

useradd –c “Kimberly Sanders” –m –s “/bin/bash” ksanders

25
Q

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?

A

usermod –l smarsden –c “Sandy Marsden “ stracy

26
Q

You need to add the aebbert user to the secondary dbusers group. Which command can
be used to do this?

A

usermod –aG dbusers aebbert

27
Q

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?

A

read SUP

28
Q

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?

A

Enter chmod u+x runme.sh at the shell prompt.

29
Q

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?

A

declare –i TOT

30
Q

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?

A

if test –w /var/opt/mydb/mydb; then…

31
Q

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?

A

if test –f /var/opt/mydb/mydb; then…

32
Q

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.)

A

for i in seq 100 & for i in seq 1 1 100

33
Q

Which protocols operate at the Network layer of the OSI model? (Choose two.)

A

IP & ICMP

34
Q

A. 11.23.5.254
B. 172.17.8.1 C. 10.254.254.1 D. 192.169.1.10 E. 137.65.5.5
Which IP addresses are private addresses?

A

B. 172.17.8.1 C. 10.254.254.1

35
Q

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
D. 255.255.255.252

A

A. 255.255.252.0

36
Q

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?

A

D. ifconfig ens32 172.17.8.1 netmask 255.255.0.0 broadcast 172.17.255.255

37
Q

Which directive in /etc/sysconfig/network/ifcfg-eth0 is used to specify whether the
interface is automatically enabled when the system is booted?

A

STARTMODE

38
Q

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?

A

/etc/sysconfig/network/routes

39
Q

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?

A

/etc/nsswitch.conf

40
Q

What is /etc/resolv.conf used for

A

it is used to configure the IP address of the DNS server but doesn’t configure the name service order.

41
Q

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.)

A

Defaults targetpw

ALL ALL=(ALL) ALL

42
Q

Which syslog facility can be used to capture log messages from an application you programmed yourself?

A

local1

43
Q

authpriv facility is used for what?

A

all services associated with system security

44
Q

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?

A

Port

45
Q

BindAddress directive is used for

A

specify the address on the local machine to be used as the source address of the connection

46
Q

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?

A

ps 1&raquo_space; /tmp/myprocesses

47
Q

Which Linux runlevel puts the system in multiuser mode with networking enabled and a command-line interface?

A

Runlevel 3 puts Linux in multiuser mode with networking enabled. The command-line interface is used.

48
Q

Runlevel 1

A

command-line interface but puts the system in single-user mode.

49
Q

Runlevel 2

A

command-line interface and runs in multiuser mode; however, it also disables networking.

50
Q

Runlevel 5

A

Linux in multiuser mode with networking enabled and a graphical user interface.

51
Q

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?

A

GRUB_DEFAULT=0

52
Q

What happens if GRUB_SAVED DEFAULT is set to true?

A

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.

53
Q

What does GRUB_HIDDEN-TIMEOUT_QUIET do?

A

GRUB_HIDDEN_TIMEOUT_QUIET=true directive causes no countdown timer to be displayed.

54
Q

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.)

A

systemctl isolate runlevel3.target systemclt isolate multi-user.target

55
Q

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?

A

gdisk /dev/sdc

56
Q

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?

A

vgcreate DATA /dev/sdb1 /dev/sdc1

57
Q

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?

A

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.

58
Q

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?

A

journalctl –b 2

59
Q

Your organization uses private IP addresses using the 192.168.0.0 addressing scheme. You need to divide your IP address space into multiple subnets, so you decide to use a 26-bit subnet mask instead of the default Class C subnet mask. Which of the following is a valid address that could be assigned to a host on the second subnet created using this subnet mask? 192.168.0.66/26 B. 192.168.0.91/24 C. 192.168.0.60/26
D. 192.168.0.138/26

A

192.168.0.66/26