Practice Questions 1 ITSY 2330
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 in command line mode takes you directly to line 82? (enter the command as if in the command mode)
#82
Under the Filesystem Hierarchy Standard (FHS), what is the full path to the directory that contains the device files for a Linux system?
/dev
What is the full path and filename of the GRUB 2 file that is used for editing the default behavior of the bootloader menu?
/etc/default/grub
What is the full path to the directory that contains user data for all standard users on the system?
/home
What is the full path to the directory that holds the man files on the system?
/usr/man
What is the full path to the directory that contains data files that change constantly, including email, print jobs, and proxy cache files?
/var
After opening a file in vi, you want to switch from command mode to command line mode. What key should you enter?
:
What command would you enter while in vi command mode to find the term Sam?
?Sam
Which environment variable affects the number of past commands stored in memory 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 environment variable overrides all other locale settings and sets all locales to the same setting?
LC_ALL
Which command displays a list of the currently defined aliases on the system?
alias
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 you enter into her shell configuration file to create this persistent alias?
alias logcheck="cd /home/mbrown/logs; ls -al"
What would you enter at the command prompt to start a new Bourne-again shell (bash) session?
bash
You are searching the standard input for any line containing "JAMESTOWN" at the end of a line. Which egrep constructor should you enter at the command prompt?
egrep JAMESTOWN$
As a Linux user, you have access to an executable file name 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
What would you enter at the command prompt to display a file's type?
file
You need to find all files in the /home/gshant directory that are larger than 300k. You change directories to /home/gshant. What command should you use?
find -size +300k
Which accessibility options adjusts the background and text colors to improve readability?
high contrast
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?
info uname
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, including hidden files and directories?
ls -a
You want to display the contents of ~/franksdep in hexadecimal format. You change to your home directory. How should you enter the command at the command prompt?
od -x franksdep
You are experiencing a problem with a network server. You want to bring the system down and try reseating the cards within it before restarting it. Which command runs poweroff.target to shut down the system in an orderly manner?
poweroff
Which command displays all the environment variables defined in the shell?
printenv env
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/ghant/smp directory is empty and need to be removed. The current working directory is /home/gshant. What would you enter at the command prmpt to remove the smp directory?
rmdir smp
Your system is currently running the multi-user.target. What would you enter at the command prompt to find out if the atd.service is configured to start every time the multi-user.target is loaded?
systemctl is-enabled atd.service
You are on a systemd system. Without rebooting the system, you want to change from currently running target unit to a target that supports networking, supports multiples users, and displays a graphical interface. What command should you enter to accomplish this task?
systemctl isolate graphical.target
After making changes to the configuration of the anaconda.service, you must make those changes take effect. Which single command do you enter to make this service use the new configuration?
systemctl restart anaconda
The current default boot target is a multi-user.target, but you want to use this system as a workstation. You need a boot target that supports multiple users, supports networking, and has a graphical display. This is a systemd system. What command should you enter to change the default boot target to one that meets these needs?
systemctl set-default graphical.target
After getting calls about users not being able to print, you check the status of the cups.service and find that it is not running. What would you enter at the command prompt to get the cups.service running?
systemctl start cups.service
What would you enter at the command prompt to find out whether cups.service is running?
systemctl status cups
What is the core process for a systemd-based Linux system?
systemd
Which command reads from standard input and writes to standard output and files?
tee
After using the locate command, you discover some of your files are not being listed in the search results. Which command should you use to update the /var/log/locatedb file?
updatedb
At the command prompt, how would you enter a command that will print the line count, word count, and byte count respectively in the /home/gshant/servepath file?
wc /home/gshant/servepath
You use a program on your Linux system called photorec. What would you enter at the command prompt to dislplay the path to the photorec binary file?
whereis -b photorec
Which component of the X11 Window System controls the placement and appearance of windows on a Linux computer?
window manager
Which command overcomes the 128 KB shell command size restriction by breaking up long lists of arguments?
xargs
What command would you enter while in vi command mode to copy an entire line of text to the general buffer?
yy
Which commands operator pipes the output of one command as the input of another command?
|