LPI: LX0-104 Scripting and Administrative Tasks Flashcards

1
Q

You are creating a special purpose and limited accounts in SUSE Linux. You want to retrieve an entry from the passwd file for a built-in user account called wwwrun.

A

getent passwd wwwrun

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

You want to create a while loop to test an i variable that you have created, with while $i less than or equal to 5.

linux-oro0:/scripts # ____

A

while [ $i -le 5 ]

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

You are configuring user access to cron and AT services. You open the cron.allow file and add hmccabe here so the user is allowed to schedule cron jobs.

Iinux-oro0:~ # vi /etc/cron.allow
linux-oro0:~ # su hmccabe
hmccabe@linux-oro0:/root> _____

A

crontab -e

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

You want to verify that the cron daemon itself is running in SUSE Linux. Type the command to do this.

linux-oro0:~ # _____

A

rccron status

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

Which command do you use to delete a user’s home directory?

A) userdel -r

B) groupdel

C) useradd —m

C) usermod

A

A) userdel -r

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

You are setting the command search path in Linux and want to display the value of the PATH variable. Select the command to do this.

A) $ PATH

B) edit $PATH

C) echo $PATH

A

C) echo $PATH

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

You are working with shell script return values. What does this code return?

linux-oro0: ~ # test 50 - lt 5 && echo “That’s true.” || echo “That’s false.”

A) 0

B) That’s true.

C) 1

D) That’s false.

A

D) That’s false.

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

You want to shorthand reference, ki, for the command “uname -r” using BASH. Complete the command to do this.

linuxoro0:~ # _____ =”name -r”

A

alias ki

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

You are maintaining skeleton directories for new user accounts in Linux. First, you want to look at the content of /etc/default/useradd.

linuxoro0:~ # _____ /etc/default/useradd

A

cat

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

You want to remove a member from a group. Which is the most appropriate command to use?

A) userdel -r

B) groupdel

C) groupmod -R

D) groupadd

A

C) groupmod -R

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

You are creating a shell script that can repeat a set of actions using the for statement. What will this code return?

linux ~ # for ((i=l;i<5;i++))

A) 1, 2, 3, 4

B) 5, 6, 7, 8, 9

C) 1, 2, 3, 4, 5

A

A) 1, 2, 3, 4

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

Which command do you use to create a symbolic link in a file to a particular timezone?

A) tzconfig

B) ln -s

C) date

D) tzselect

A

D) tzselect

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

You are performing conditional mailing to the superuser in a shell script. Match each command to what it can be used for.

1) Check Mail
2) Verify the content of the subject line of the message
3) Analyze the summarized space usage of a subdirectory

A) -s

B) du -s

C) mail

A

1) C) mail
2) A) -s
3) B) du -s

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

You want to remove the permissions for other users in the activeusers.sh file. Which command do you use?

A) useradd -m

B) chown

C) chmod u+s

D) set

E) chmod

A

E) chmod

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

You are configuring an environment variable in Linux. What command do you use to set the scope of a variable?

A) source

B) echo

C) set

D) export

C) env

A

A) source

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

Which statements about Anacron are true?

A) Runs even if the system was turned off

B) Designed specifically to run on servers

C) Runs daily, weekly, and monthly

D) Useful for Linux laptops and desktops

E) Only root can schedule Anacron jobs

F) The config file is called crontab.config

A

A) Runs even if the system was turned off

C) Runs daily, weekly, and monthly

D) Useful for Linux laptops and desktops

E) Only root can schedule Anacron jobs

17
Q

Which command do you use to create a symbolic link in a file to a particular timezone?

A) iconv

B) locale

C) ln -s

D) $LANG

A

C) ln -s

18
Q

You want to create an age variable with a value of 30 in the C shell.

/scripts# _____

A

set age=30