CSCI 386 Exam 1
^G (Ctrl + G)
Displays the help text, which includes a list of all keyboard shortcuts
.profile
Each time you present credentials to log in, you want a particular entry to be written to a log file. This action will only apply to yourself. You are using the bash shell. Which of the following configuration files is the BEST to modify to enable this action?
From the prompt, type echo $variable and then press Enter to view what is stored in the variable.
Find the value of the desired environment variables.
Name Server
Resolves (or maps) the fully qualified domain names (FQDNs) to IP Addresses.
~/.bashrc
Select the file that is called by the non-login shell configuration file.
cc
command deletes the entire line of text at the cursor location and places the deleted text in the general buffer
:q
command exits vi, but only if there are no changes
u
command performs an undo of the last action
:wq
command save the file and quits vi
:x
command saves the file it is has changed and quits vi
:q!
command to exit without saving the changes made to a file
p
command to paste text from the text buffer into the document while in command mode
Logging
Capturing a timeline of events that have taken place on the computer in the form of a file
^X (Ctrl + X)
Closes the current buffer or exits from nano
Command mode
The initial mode used when vi is started. It has commands that cut and replace text, and it is the mode vi uses to enter the other modes.
Linux on mobile devices
Used by Google on many of the physical products it sells
alias
What command displays a list of the currently defined aliases on the system?
ll
What commonly predefined alias is configured to run the ls -l command?
cat turbo
Which of the following commands gives the same results as cat < turbo
info sysctrl
Which of the following commands would you enter to view info node information about the sysctrl command?
export COMP=1745
You need to set the COMP variable to the value 1745. Which of the following commands sets the variable, so it is inherited by subsequent child shells?
man -k bluetooth
You want to search all the man pages for information available for the Bluetooth protocol. Which of the following commands would you enter to display this information?
Embedded Linux
Manages intelligent devices, such as automations and control equipment
[command] --help
Quick help on a command
Edit mode
The vi mode used to write and edit text in the file
^U (Ctrl + U)
Uncuts (pastes) the text from the cutbuffer into the current line
/Sam (searches forward for all instances of a term) ?Sam (searches backwards for all instances of a term)
What command would you enter while in vi Command Mode to find the word Sam?
login
What type of shell runs after the user successfully logs in using an ID and password?
bash
What would you enter at a command prompt to start a new Bourne again shell (bash) session?
./ni /root/ni
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? (Choose two) ./ni source ni ni exec ni /root/ni
Proxy
A computer that provides indirect internet access to the computer in your network
#82
A friend sends you a shell script file that is 117 lines long. He says that he wants you to check the code on lines 82 through 87. What command would you enter while in vi command mode to go directly to line 82?
Web Server
A program responsible for accepting HTTP (Hypertext Transfer Protocol) requests from clients
SNMP
A protocol used to communicate with and monitor network devices and servers
SSH
A protocol used to securely log on to remote systems using encryption
VPN
A type of network that uses encryption to allow IP traffic to travel securely over the TCP/IP network
~/.bash_profile
A user starts a bash session and the script in /etc/profile. If all of the following files exist, which will be run next?
Database
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?
/etc/profile
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?
yum install httpd
An IT technician has been given a work order to install the Apache web server on a system configured with a YUM repository. Which of the following commands will install the web server?
/etc/profile ~./bash_profile
Anna, a system administrator, wants to set an environment variable that can be used each time she logs in. Currently, Anna has to set the variable each time a terminal is opened. Which of the following files would Anna need to modify to make the variable a global environment variable? (Select two.)
exec ./myapp
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 my app process?
^K (Ctrl+K)
Cuts the current line (or selected text) and stores it in the cutbuffer
Home
If you are viewing the contents of a man page, which key can you press to get back to the beginning of the page?
/etc/passwd
In which of the following files is the user's preferred shell normally set?
Load Balancer
Increases response time to back-end servers by distributing the workload across the available servers
Linux and Cloud Computing
Infrastructure as a Service (IaaS)
alias logcheck="cd /home/mbrown/logs;ls -al"
Mary Brown is a Linux user with the username mbrown. Mary 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 run these two commands. What command would Mary enter into the shell configuration file to create this persistent alias?
j
Match the vi command on the left with the correct description of the cursor movement the on the right. Move the cursor down a line
h
Match the vi command on the left with the correct description of the cursor movement the on the right. Move the cursor one space to the left
l
Match the vi command on the left with the correct description of the cursor movement the on the right. Move the cursor one space to the right
k
Match the vi command on the left with the correct description of the cursor movement the on the right. Move the cursor up a line
^Space (Ctrl + Space)
Moves forward one word in the current line
Linux virtualization
Running Linux and Windows on the same physical computer.
*.sh files in /etc/profile.d
Select the file type from the drop-down list below that is also called by non-login shell configuration files.
Command Line Mode
The vi mode that works with the file system. Use it to save files after editing them.
export val=5000
Tim, a technician, creates a local variable named val and sets 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 val as an environment variable that would be available to the script?
From the Terminal prompt, type nano /etc/resolv.conf and press Enter. Use the arrow keys to move to the nameserver line you want to edit. Press End to move to the end of the line. Press Backspace to delete the existing IP address for the selected nameserver. Type 163.128.78.93. Repeat steps 2a-2d, but use 163.128.80.93 for the second nameserver IP address. Type Ctrl + O. Press Enter to save the file. Type Ctrl + X to exit the editor.
Use nano to open the /etc/resolv.conf file Modify the /etc/resolv.conf file to use the new nameserver addressees Save the changes made to the /etc/resolv.conf file
From the Favorites bar, select Terminal. From the Terminal prompt, type vim /etc/pref_shell and press Enter to open vim and create the file. Press the i key to enter insert mode. Type the following text: SHELL=/bin/csh export SHELL Press the Esc key to exit the insert mode. Type : to enter the command line mode. Type wq (or ZZ) and press Enter to save (write) the file and exit (quit).
Use the vim text editor to open a new file Add the required text to the file Save and close the file
Non-login
What type of shell runs when a user opens a shell after first authenticating with a user ID and password?
pwd
What would you enter at the command prompt to display the current working directory?
1 or more
When creating a custom alias, how many commands can you add the alias?
A unique bundling of the Linux kernel
When working with Linux, it is important to understand what distributions are and how they are used. Which of the following BEST describes a Linux distribution?
printenv
Which command displays all the environment variables defined in the shell?
Alias
Which of the following Linux features lets you store a shortcut in memory or as part of the shell configuration file that runs a specific command?
Adding the command defining the alias to the appropriate shell configuration
Which of the following actions defines a persistent alias?
They are more verbose and emphasize how to use commands and utilities They contain hypertext links to navigate between nodes
Which of the following are characteristics make info nodes different from man pages? (Select two) *They contain a SYNOPSIS section for reviewing the syntax of a command. *They are more verbose and emphasize how to use commands and utilities. *They contain hypertext links to navigate between nodes. *You can use the PgUp and PgDn keys to move one page at a time. *You can use the End key to go to the end of a page.
When the Linux system does not have a GUI and the user logs in using the text-based interface. When a user runs the sudo -i <user ID> command and enters the correct password.
Which of the following are examples of a user running a login shell? (Select two.) When the Linux system does not have a GUI and the user logs in using the text-based interface. When a user opens a shell session (terminal application) from within the GUI. When a user runs the sudo -i <user ID> command and enters the correct password. When a user opens a new shell from a shell prompt. When a user runs the sudo <user ID> command without the -i option.
When a user runs the sudo <user ID> command without the -i option. When a user opens a shell session (terminal application) from with the GUI.
Which of the following are examples of a user running a non-login shell? (Select two.) When a user runs the sudo <user ID> command without the -i option. When the Linux system does not have a GUI and the user logs in using the text-based interface. When a user logs in from a remote system using the SSH protocol. When a user opens a shell session (terminal application) from within the GUI. When a user runs the sudo -i <user ID> command and enters the correct password.
HISTFILESIZE=300
Which of the following commands configures the shell to retain 300 recently used commands in the ~/.bash_history file for multiple shell sessions?
alias sysmesg="tail -f /var/log/messages"
Which of the following commands creates a shortcut that can be used to run the tail -f /var/log/messages command?
echo $LANG
Which of the following commands displays the value of the LANG environmental variable currently set for the language the operating system uses?
what is apropos man -k
Which of the following commands searches man pages for a specific keyword? (Select three.) apropos slocate find man -k export whatis help
history
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?
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?
~/.bashrc ~/.profile
Which of the following files could you use to create aliases that are applied when a specific user starts a bash session? (Select two.) /etc/profile /etc/bashrc ~/.bash_logout ~/.bashrc ~/.profile
All system information
Which of the following is displayed when the uname -a command is run?
Store messages so they can be downloaded or send email to destination MTA
Which of the following is the primary role of a mail transfer agent (MTA)?
Bourne again shell (bash)
Which of the following is the standard shell for most Linux computers?
DESCRIPTION
Which of the following man page sections shows a list of options available for a Linux command and explains what the options do?
^G (Ctrl+G)
Which of the following nano editor keyboard shortcuts displays help text, including a list of all keyboard shortcuts?
Keyboard shortcuts are displayed at the bottom of the editor
Which of the following nano text editor features makes it easier for beginners to learn than the vi text editor?
It contains the directory prefixes used to search for programs and files
Which of the following statements BEST describes the PATH environment variable?
<Esc>:wq
Which of the following vi key combinations should you press while in Insert Mode to save the file you are working on and exit the editor?
echo $0
You are at a terminal command prompt in a Linux GUI interface that someone else has been using and want to find out which shell type is currently being used by the terminal. What command can you enter to find out the current shell type?
Ctrl+Alt+F4
You are managing a Linux server with a console (without a GUI installed) Which of the following key combinations would you press to switch to the fourth shell session?
uname --help
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?
unalias listgroups
You have created a listgroups alias that you now want to remove. Which of the following commands will remove the alias?
help -d whoami
You have forgotten what information is provided by the whoami command, and simply want a short description of the command. Which of the following help commands could you enter to view that short description?
A one-line man page description for the grep command
You have just entered the apropos grep command at the command prompt. What can you expect to be displayed?
export HOST
You recently used the HOST=FS4 command. Which of the following commands should you use to change the HOST variable to an environment variable that will be inherited by subsequent child shells and processes?
PATH=$PATH:/sbin/special
You want the directory /sbin/special to be include in the PATH environment variable. You also want to keep all the current directory entries currently in the PATH variable. Which of the following commands would you use?
alias grepcolor="grep --color=36"
You want to create a grepcolor alias that provides a lime green (36) background color to the search terms when using the grep command. You want this command to be persistent when rebooting your Linux server. What command would you enter into the shell configuration file to create this persistent alias?
/home/user/.bashrc /etc/profile
You want to make an alias persistent across all reboots of your Linux server. In which of the following files do you need to place the alias command to make the alias persistent? /home/user/.bashrc /home/user/.bash_profile /etc/profile /etc/resolv.conf /etc/securetty
mkdir --help | more
You want to view the Linux help information for the mkdir command. While viewing the information, you want to be able to scroll through the onscreen help. What is the command you would use to display and be able to scroll through the mkdir help information?
echo $HISTSIZE
You want to view the number of commands your bash shell is set to save by examining the current HISTSIZE environment variable. You don't want to have to scroll through all the environment variables. Which of the following commands is the BEST way to determine the current value of the HISTSIZE variable?
Containers
Your company develops applications to run on Linux systems. You currently have four development teams, each 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 affecting your part of the project or your operating system and personal files?
Monitoring
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 server roles should be installed to provide this functionality?
File servers
Your company uses both Linux desktops and Windows desktops. Which of the following server roles should you use to provide a central location for users of both operating systems to share files?
dw
command deletes a whole word and trailing space and places the deleted text in the general buffer