Test Out Linux Pro - Exam 1

Ace your homework & exams now with Quizwiz!

A friend sent you a shell script file that is 117 lines long. He says that he wants you to examine code on lines 82 through 87. What command would you enter while in vi Command Mode to go directly to line 82?

#82

According to the command help, which of the following options can be added to the killall command to kill a process group instead of just a process? Type killall -h or killall --help at the prompt to answer this question.

-g

A user has requested that each time she presents credentials to log in, a particular entry be written to a log file. This action will only apply to her, and she is using the bash shell. Which of the following configuration files is the BEST to modify to enable this action?

.profile

What command would you enter while in vi command mode to find the term Sam?

/Sam

All users at your site are using the bash shell. You want to set a variable that will apply to every user and always have the same value. Which of the following shell configuration files should you place this variable in?

/etc/profile

A Linux user has an executable file named ni that can save a snapshot of network information with the date and time in a log file. The executable ni file is in the /root directory, and /root is the current working directory. Which of the following commands would run the executable file? (Select TWO).

/root/ni ./ni

After opening a file in vi, you want to switch from Command Mode to Command Line Mode. What key invokes Command Line Mode?

:

Which of the following vi key combinations should you press while in Insert Mode to save the file you are working on and quit?

<Esc>:wq

Which of the following is displayed when the uname -a command is run?

All system information

Which of the following is the standard shell for MOST Linux computers?

Bourne-again shell (bash)

Which of the following man page sections shows a list of options available for a Linux command and explains what the options do?

DESCRIPTION

If you are viewing the contents of a man page, which key can you press to get back to the beginning of the page?

Home

Using the vi editor in Insert Mode, you made a few changes to the /boot/grub/grub.conf file. You now need to switch to command mode, save the changes, and quit. Which of the following keystrokes and commands should you use? (Select TWO.) (Each answer is a required part of the solution.)

Press the Esc key Type :wq

Linux can be implemented in many different ways. Drag the implementation type to the definition that matches it BEST.

Running Linux and Windows on the same physical computer. ( Linux virtualization) Infrastructure as a Service (IaaS). (Linux and Cloud Computing) Used by Google on many of the physical products it sells. (Linux on mobile devices) Manages intelligent devices, such as automation and control equipment. (embedded Linux)

Which of the following describes the effects of the ls -l /usr/bin >> /tmp/list.txt command?

The contents of the /usr/bin directory are written to a file named /tmp/list.txt. Previous file contents are kept, and the new information is added at the end of the file.

What does the -M switch do when used with the useradd command? Type useradd -h or useradd --help at the prompt to answer the question.

The home directory is not created, regardless of system settings.

Match the vi mode on the left to the correct definition on the right.

The initial vi mode used when vim is started. It has commands that cut and replace text, and it is the mode vi uses to enter the other modes. (Command Mode) The vi mode that works with the file system. Use it to save files after editing them. (Command Line Mode) The vi mode that vim uses to write and edit text in the file. (Edit Mode)

According to the command help, which of the following is the result of adding -G to the usermod command as a single option? Type usermod -h or usermod --help at the prompt to answer the question.

The user is assigned to a new list of supplementary groups.

Which of the following commands creates a shortcut that can be used to run the tail -f /var/log/messages command?

alias sysmesg="tail -f /var/log/messages"

Which of the following commands stores the output of the ls -a command in a shell variable named allfiles?

allfiles=$(ls -a)

Which of the following commands searches man pages for a specific keyword? (Select THREE.) export slocate find apropos help whatis man-k

apropos whatis man -k

What would you enter at the command prompt to start a new Bourne-again shell (bash) session?

bash

Which of the following commands sorts the combined contents of the wordlist1 and wordlist2 files and sends the results to both the screen and a file named sortedwordlist?

cat /usr/wordlist1 /usr/wordlist2 | sort | tee sortedwordlist

Which of the following commands gives the same results as cat < turbo?

cat turbo

Which of the following commands shows the value of the LANG environmental variable currently set for the language the operating system uses?

echo $LANG

As a Linux user, you have access to an executable file named myapp. It's found in the current directory, but not in the command path. What would you enter at the command prompt to start the myapp file and replace the shell with myapp process?

exec ./myapp

Which of the following commands should a Linux user enter to see a list of all the commands the user recently ran at the command prompt?

history

Ann, a Linux script developer, is trying to debug a shell script that has the command ls -s in it. She suspects that an error is occurring, and she wants to send the results of the operation and any errors to a file named ~/Friday in order to examine it later. Which of the following commands should she use?

ls -s &> ~/Friday

You are working on a Linux system and need more information about the uname command. What would you enter at the command prompt to learn about the uname command syntax and options?

man uname

While in vi Command Mode, you copy a whole line of text to the general buffer. You then navigate to a different location in the file. Which of the following commands will paste the copied text?

p

What would you enter at the command prompt to display the current working directory?

pwd

As an administrator, you are tasked with configuring an Apache web server by modifying the /etc/apache2/apache2.conf file. You open the file in vi. As you're looking at the file, you knock your spill-proof drink container onto the keyboard. It rolls over several keys as you try to pick it up. Now there are extra characters everywhere in the text buffer. Which of the following commands can you use to exit vi without saving any changes that were made to the text buffer?

q!

Which command reads from standard input (stdin) and writes to both standard output (stdout) and a file?

tee

What command would you enter while in vi command mode to copy an entire line of text to the general buffer?

yy

Which command operator pipes the output of one command as the input of another command?

|

After a user starts a bash session and the script in /etc/profile is applied, if all of the following files exist, which will be run next?

~/.bash_profile


Related study sets

Chapter 8 - Groups and Teams - OB

View Set

Chapter 49: Assessment and Management of Patients With Hepatic Disorders

View Set

Term 1 V.T.5 Breed Identifications (Canine)

View Set

Sociology Ch. 10 Gender Inequality

View Set