CIT 412 Chapters 1 & 2

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

A friend sent you a shell script file that is 117 lines long. He says that he wants to examine code on lines 82 and 87. What command would enter while 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 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).

./ni /root/ni

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

.profile

Which of the following represent the root directory?

/

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

/Sam

Under the Filesystem Hierarchy Standard (FHS), what is the full path to the directory that contains the device files for a Linux system?

/dev

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. What file would you place this variable in?

/etc/profile

Anna, a system administrator, wants to set a global variable that can be used each time she logs. Currently, she has to set the variable each time a terminal is opened. Which of the following files would need to be modified to make a global variable persistent?(Choose TWO.)

/etc/profile ~./bash_profile

Drag the server role to its proper description

1) A protocol used to communicate with and monitor network devices and servers SNMP 2) A protocol used to securely log on to remote systems using encryption. SSH 3) Resolves (or maps) the fully qualified domain names (FQDNs) to IP Addresses. Name Server 4) A program responsible for accepting HTTP (Hypertext Transfer Protocol) requests from clients. Web Server

Drag the server role to its proper description

1) Capturing a timeline of events that have taken place on the computer in the form of a file. Logging 2) A network that uses encryption to allow IP traffic to travel securely over the TCP/IP network. VPN 3) Increases response time to back-end servers by distributing the workload across the available servers. Load Balancer 4) A computer that provides indirect internet access to the computers in your network. proxy

Linux can be implemented in many different ways.

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

Which of the following commands utilize command substitution? (Choose TWO.)

1. myvar=`sort -r names.txt` 2. myvar=$(sort -r names.txt)

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

:

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 key combination should you press in vi to save the file you are working on and quit?

<Esc>:wq

You must do which of the following to define a persistent alias?

Add the command defining the alias to the appropriate shell configuration file

Which of the following is displayed when the uname -a command is run? 1. The current working directory 2. The names of files and directories in the current directory 3. All system information 4. The current username

All system information

Tim, a system administrator, wants to simplify the provisioning and disabling of user accounts. Which of the following server roles should Tim install and configure?

Authentication Server

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

Bourne-again shell (bash)

Your company recently setup a VPN and wants to use a digital certificate for authentication instead of a pre-shared key. Which of the following server roles would allow the company to provide this functionality internally instead of using an external provider?

Certificate Authority

Your company is running a critical business application. The executive team wants to ensure the server is available at all times, even in the event of a server failure. Which of the following server roles would be used to provide a failover server in the event of a system failure?

Clustering

The vi mode that works with the file system. use it to save files after editing them.

Command Line Mode

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

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

DESCRIPTION

Users are complaining that they are unable to connect to any servers or the internet. Based on the symptoms they describe, you suspect that the users are not being assigned the correct IP addresses.

DHCP

Alex, a webmaster, is implementing an order processing system on the company's website. Which of the following server roles should Alex implement with the order processing application?

Database

The vi mode that vim uses to write and edit text in the file

Edit mode

Your company uses both Linux desktops and Windows desktop. Which of the following server roles should be used to provide a central location for users of both operating systems to share files?

File Servers

Which of the followign commands will configure the shell to retain 300 recently-used commands in ~/.bash_history file for multiple shell sessions?

HISTFILESIZE=300

Which environment variable affects the number of past commands used in the current shell session?

HISTSIZE

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

Which of the following statements best describes the PATH environment variable?

It contains the directory prefixes used to search for programs and files

Which of the following nano text editor features makes it easier for beginners to learn that the vi test editor

Keyboard shortcuts are displayed at the bottom of the editor

Your company has been expanding the number of servers in the company's data center and there is an increased need to gather metrics, watch process states, work with logs, watch services states and file system usage. Which of the following sever roles should be installed to provide this functionality?

Monitoring

Users are complaining that the clocks for their operating systems do not match the current time for the location in which they liveWhich of the following server roles is BEST for correcting this issue?

Network Time Protocol NTP

You want the directory /sbin/special to always be a part of the PATH. You also want to keep all the current entries in your PATH statement. Which of the following commands would you use?

PATH=$PATH:/sbin/special

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

Which of the following server roles would you implement to provide services offered by CUPS and IPP?

Print Server

Which of the following is the primary role of a mail transfer agent (MTA)?

Store messages so they can be downloaded or send email to a destination MTA.

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. Previos file contents are kept, and the new info is added at the end of the file.

Ted, a Linux user, creates symbolic links in his home directory to set of files in their /data directory using the ln -s command. Later, a system administrator deletes the files in the /data directory. What happens to the symbolic links that Ted created?

The symbolic links still exist in Ted's home directory, but they are useless because the link has been broken

Which statement describes file globbing?

Using wildcards to match specific files.

Which of the following nano editor keyboard shortcuts will display help text which includes a list of all keyboard shortcuts.

^G (Ctrl+G)

Which command will display a list of the currently defined aliases on the system?

alias

The user mbrown has a directory named logs in her home directory that is regularly updated with new log files when certain system events occur. She runs the following commands several times a week to check this directory: cd /home/mbrown/logs ls -al She wants a persistent alias named logcheck to be created to run these two commands. Which command would you enter into her shell configuration file to create this persistent alias?

alias logcheck="cd /home/mbrown/logs;ls -al"

Which of the following commands will create a shortcut to 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 name all files?

allfiles=$(ls-a)

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

bash

Which of the following commands can be used to combine the content of three files into a single text stream?

cat

Which of the following commands sorts the contents of the wordlist1 and wordlist2 files and sends the results to standard output?

cat /usr/wordlist1 /usr/wordlist2 | sort

Which of the following commands displays the contents of wordlist1 and wordlist2 then sorts the combined contents, then sends the results to the monitor and a file named sortedwordlist?

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

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

Your company develops applications to run on Linux systems. You currently have four teams working on a different aspect of the same application. Which of the following server roles would give you the BEST method for testing all team members' code without effecting your part of the project or your operating system and personal files?

containers

Which of the following command copies the entire /temp directory ith all of its files, sub- directories, and files in the sub-directories to the /home/gshant directory . (Select TWO. Each answer represents and independent solution.)

cp -r /temp /home/gshant cp -R /temp /home/gshant

A Linux administrator is logged in as root and needs to copy a file name letter.doc from the USB flash drive mounted under /media/usb. Which of the following commands will copy the file from the USB flash drive to the root user's home directory?

cp /media/usb/letter.doc /root

Tom, a shell script developer, knows that the date + %A command gives the current local weekday name(Sunday, Monday, Tuesday, ...). Which of the following commands will copy the authentication log file, /var/log/auth.log, to a new file that with a filename that includes the current local weekday name?

cp /var/log/auth.log ~/auth$(date +%A).log

You want to view the number of commands your HISTSIZE envrioment variable is set to save. You don't want to have to scroll through all the envrioment variables. Which command shows you the value for the HISTSIZE variable?

echo $HISTSIZE

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

echo $LANG

Two users should have identical settings, yet one is having problems with the display on his screen and you suspect there is a difference in their environment variables. Which command will display all the environmental variables?

env

Which command displays all the environment variables defined in the shell?

env

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

You need to set the COMP variable to the value 1745. Which command will set the variable so it is available to other shell programs?

export COMP=1745

You recently used the HOST=FS4 command. What command should you use to make the environment variable to apply to all child sessions.

export HOST

Tim, a technician, created a local variable named val and set it to 5000 at the bash prompt. Tim wants to use the variable in a script. But when the script is executed, the value of val is not set to 5000. Which of the following commands would allow Tim to set a global variable that would be available to the script?

export val=5000

What would you enter at the command prompt to display a file's type?

file

Move the cursor one space to the left

h

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

Move the cursor down a line

j

Move the cursor up a line

k

move the cursor one space to the right

l

What commonly predefined alias is configured to run the ls -l command

ll

You need to view the contents of the /home/jerrys directory. What would you enter at the command prompt to show all the contents, hidden files and directories?

ls -a /home/jerrys

Which of the following commands displays an expanded listing that includes the owner and size of all the files in the /etc directory?

ls -al/etc

A user attempts to view the contents of a directory, but the output of the ls -l command scrolls beyond the limit of one console window. Which of the following commands would allow the users to see the full listing of the directory?

ls -l | less

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 name ~/Friday in order to examine it later.

ls -s&> ~/Friday

Which of the following commands will display the attributes of a /boot/gub/grub.conf file?

lsattr /boot/grub/grub/conf

Which of the following commands could you use to search man pages for a specific keyword?

man -k whatis apropos

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

Fred, a Linux administrator, needs to create the directory /var/oracle/database/9i. Only the directory /var currently exists. The current working directory in the root of the filesystem. Which of the following commands will create the directory path?

mkdir -p /var/oracle/database/9i

Which of the following commands will move a file from one location to another?

mv

Which of the following commands will change the /home/pmallory/reportsfile's name to reports.bak?

mv /home/pmallory/reports /home/pmallory/reports.bak

Joe, a bash script developer, is trying to debug a shell script named my script. Which of the following commands would record the output of the script in a text file?

myscript>>testfile.txt

While in the 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 pastes the copied text?

p

Which command will merge two files on a line-by-line basis, and separate each line with a tab?

paste

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

pwd

Within the /var directory is a sub-directory named backup. Ken, a Linux administrator, needs to delete the directory and any files that it contains. He changes directory focus to /var. Which of the following commands deletes the directory named backup and any file it contains?

rm -r backup

The /home/gshant/smp directory contains several files. The directory and files need to be removed. The current working directory is /home/gshant. What would you enter at the command prompt to remove the smp directory and all the files it contains?

rm -r smp

The /home/gshant/smp directory is empty and needs to be removed. The current working directory is /home/gshant. What would you enter at the command prompt to remove the smp directory?

rmdir smp

A user, ljenkins, contacts the help desk about and error received while removing a file from their home directory. The user received the following error when trying to use the rm command to remove the file:

sudo chattr -i report.txt && rm report.txt

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

tee

The ls command in the current working directory gives the following listing: lrwxrwxrwx 1 root root 4 2010-11-05 mydata -> shantsgems -rwxr -xr -x 1 root root 382 2010-0-05 shantsgems

the mydata file is a symbolic link to the shantsgems file

Which of the following commands will change the /home/gshants/smilefile's modification and last accessed times to the current time?

touch /home/gshants/smile

Which command overcomes the 128 KB shell command size restriction by breaking up long lists of arguments?

xargs

A technician has been given a work order to install the Apache webserver on a system configured with a YUM repository.Which of the following commands will install the webserver?

yum install httpd

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

yy

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

|

After a user starts a BASH session and the scripts in /etc/profile are applied, if all of the following files exist, which will be run next? 1) ~/.bash_logout 2) ~/.bash_login 3) ~/.profile 4) ~/.bash_profile

~/.bash_profile

Which of the following files would you use to create aliases that are applied when a specific user starts a BASH session? (Select two.) /etc/profile ~/.bash_logout ~/.bashrc ~/.profile

~/.profile ~/.bashrc


Set pelajaran terkait

Study Guide for Unit 2, Module 1 (Chapter 4 - A Tour of the Cell)

View Set

Data Abstraction & Problem Solving with JAVA: Chapter 5 - Linked List

View Set

AP Chemistry 1st Semester Exam Study Guide

View Set

Chapter 21: Gynecologic Emergencies

View Set

Baroque Final Exam Monument List

View Set