LPI: LX0-104 Scripting and Administrative Tasks Flashcards
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.
getent passwd wwwrun
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 # ____
while [ $i -le 5 ]
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> _____
crontab -e
You want to verify that the cron daemon itself is running in SUSE Linux. Type the command to do this.
linux-oro0:~ # _____
rccron status
Which command do you use to delete a user’s home directory?
A) userdel -r
B) groupdel
C) useradd —m
C) usermod
A) userdel -r
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
C) echo $PATH
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.
D) That’s false.
You want to shorthand reference, ki, for the command “uname -r” using BASH. Complete the command to do this.
linuxoro0:~ # _____ =”name -r”
alias ki
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
cat
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
C) groupmod -R
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) 1, 2, 3, 4
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
D) tzselect
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
1) C) mail
2) A) -s
3) B) du -s
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
E) chmod
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) source