lpic Flashcards Preview

Linux+_acad > lpic > Flashcards

Flashcards in lpic Deck (59):
1

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

/etc/bashrc & ~/.bashrc

2

which bash config files are used for login shell sessions?

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

3

name two ways to get more info on a command

man & info

4

how to switch into insert mode in VI?

press I key or Insert button

5

how do you quit vi without without savings changes?

:q!

6

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

mkdir ~/MyFiles

7

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

uname

8

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

:wq & :exit

9

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

10

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

chmod 660 widgets.odt

11

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

-aG

12

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

until

13

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

while

14

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

samba for file CUPS for printing

15

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

16

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

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

17

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

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

18

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

/etc/shadow

19

whats stored in /etc/passwd

user accounts

20

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

1001

21

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.

22

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

7.

23

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

/etc/login.defs

24

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

25

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

26

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

usermod –aG dbusers aebbert

27

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?

read SUP

28

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.

29

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

30

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

31

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

32

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`

33

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

IP & ICMP

34

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?


B. 172.17.8.1 C. 10.254.254.1

35

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

36

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

37

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

STARTMODE

38

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?

/etc/sysconfig/network/routes

39

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?

/etc/nsswitch.conf

40

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.

41

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

Defaults targetpw
ALL ALL=(ALL) ALL

42

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

local1

43

authpriv facility is used for what?

all services associated with system security

44

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?

Port

45

BindAddress directive is used for

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

46

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

47

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.

48

Runlevel 1

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

49

Runlevel 2

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

50

Runlevel 5

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

51

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?

GRUB_DEFAULT=0

52

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.

53

What does GRUB_HIDDEN-TIMEOUT_QUIET do?

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

54

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

55

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?

gdisk /dev/sdc

56

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

57

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.

58

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

59

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

192.168.0.66/26