Dcom 142 Final
Which of the following options for the useradd command allows root to specify supplementary groups the user will be a member of?
-G
Which option for the usermod command can be used to specify a user's group ID (either primary or secondary)? (choose two)
-g -G
What is the correct way to assign the word "Hello" to a variable?
. A="Hello"
If a user is deleted, the files and directories that the user owned...
...will show a UID as the owner, but not user name.
The usermod command can be used to do all of the following except
..change the user's MAX and MIN password settings.
Which of the following files contains encrypted user password information?
/etc/shadow
The if command looks for what exit code to consider a condition to be true?
0
What is the correct way to save the current directory to a variable?
A=`pwd`
A user can belong to.
At least 16 groups
The "execute" permission on a directory allows you to: (choose three)
Change to that directory or use it as part of a path Along with write permission to successfully create new files Along with read permission to successfully perform ls -l
Most of nano's commands take the form of:
Control and another character
What does this shell script do? FOO=/tmp/foo if [ ! -d $FOO ]; then mkdir $FOO fi
Creates /tmp/foo if it does not exist
A load average of 1.0 always means the system is fully loaded.
False
A user cannot delete a file if they do not own it.
False
All log files contain only text data.
False
GUI text editors for ASCII are superior to text-mode ASCII text editors because the GUI editors support underlining, italics, and multiple fonts.
False
On a system that does not use UPG, the useradd command will also create a user group. For example, user bob, group bob.
False
The /etc/shadow file contains plain-text passwords.
False
The chgrp command can be used to change the owner and group of a file.
False
The groupmod command can be used to add users to a group.
False
The following are valid Linux option styles: (choose three)
GNU long options with two dashes (--) Traditional Unix with a single dash (-) BSD Unix without a dash
Name the 2 programs that was setup in the linux Mint on the last class.
IRC Mail
Given the following script that is run through ./test.sh hello goodbye: if [ -f $2 ]; then echo "I am here" fi When will "I am here" be printed?
If a file called "goodbye" exists in the current directory
How would you remove two lines of text from a file when using vi?
In command mode, position the cursor on the first line and type 2dd.
The echo command:
Is used to output text to the console
Given the following part of a script: if [ -f $1 ]; then echo "I am here" fi What is the meaning of $1?
It is the first argument passed to the script
What does the acronym RPM mean?
RPM Package Management
A file begins with #!/bin/csh. This means:
Running the script will invoke /bin/csh to interpret the rest of the file
UIDs 1-500 are usually reserved for what kind of users?
System accounts, such as server processes
What information is held inside $? ?
The previous command's exit code
Which user can view the /etc/shadow file?
The root user
A GID is associated with a group name.
True
For non-root users, the passwd command can only be used to change the password of the user running the command.
True
If you have never used a text editor before, the nano text editor is usually the best one to learn first.
True
In distributions that do not allow the root user to login directly or via the su command, the installation process automatically configures one user account to be able to use the sudo command to execute commands as if they were executed by the root user.
True
The /etc/sudoers file should be edited directly by root using the visudo command.
True
The /proc directory contains a subdirectory for each process present on the system.
True
The groupmod command can be used to change a group GID
True
The groupmod command can be used to change a group name.
True
What is the name of the software that we downloaded.
Wingide
Which of the following are package management commands for distributions with software distributed in files ending in .deb? (choose three)
aptitude apt-get dpkg
A conditional that lets you make multiple comparisons with a pattern is called:
case
Which of the following commands set "other" permissions on file to r-x?
chmod o=rx file
Which command can be used to view the /etc/passwd file entries?
getent
The /etc/group file follows what structure?
group_name:password_placeholder:GID:user_list
Which command will display the UID, GID and groups your current user belongs to?
id
Which of the following commands will display the groups that the user bob belongs to? (choose one)
id bob
Which of the following are methods for setting permissions using the chmod command? (choose two)
octal symbolic
Given the following script: while [ ! -f /tmp/foo ]; do echo -n "." process_data > /tmp/foo done Which of the following are true? (choose two)
process_data will be called at most once If a file called /tmp/foo exists, process_data won't be run
Which of the following commands will allow you to switch to the user, branch? (choose three)
su -l branch su - branch . su branch
The number of users logged in is in a variable called USERS. How would you test to see if 5 users are logged in?
test $USERS -eq 5
How would you write a test that says "if /tmp/foo is a directory or USERS is greater than 5"?
test -d /tmp/foo -o $USERS -gt 5
While in vi's command mode, you can type to undo a change.
u
Which of the following commands, run as root, will prevent the user bob from logging in?
usermod -L bob
Which option for the chown command can be used to change the owner of a directory and all the files and directories below it?
-R
What option to the netstat command has information shown as numbers rather than names?
-n
A service is...
.a feature provided by one computer to another.
Which files contain user account information? (choose two)
/etc/passwd /etc/shadow
Only servers have hostnames.
False
The chgrp command can be used on a file by:
The file owner and root
Sudo privileges can be used to specify which user can use the sudo command to execute commands as other users.
True
The "execute" permission is never set on files by default.
True
Which of the following commands can be used to modify a group?
groupmod
Which command will display the users that are currently logged in to the system?
who
The userdel command will...
will prompt before deleting each file owned by a user.
Which of the following options for the useradd command allows root to specify the UID to be associated with the account?
-u
Which of the following commands will add the group extra to the user bob's secondary groups in addition to bob's current secondary groups?
. usermod -aG extra bob
The sudo command allows regular users to.
...run certain commands as the root user.
Which of the following files does the groupadd command use to determine the new GUI when a GUI isn't specified?
/etc/group
Which of the following files contains user IDs?
/etc/passwd
To make changes permanent for kernel parameter files found under /proc/sys, the following file can have entries added to it:
/etc/sysctl.conf
What directory contains user's home directories?
/home
The Linux kernel mounts the following pseudo-filesystems to provide access to information about hardware devices connected to the system: (choose two)
/proc /sys
Which file contains the information passed to the kernel at boot time?
/proc/cmdline
What directory typically contains log files?
/var/log
The Process ID (PID) of the init process is
1
The following system load averages are displayed by the top command: (choose three)
1 minute 5 minute 15 minute
What is the meaning of $(( $i + 1)) ?
1 will be added to the i variable
Which of the following are valid IPv4 addresses? (choose two)
10.33.55.77 192.105.10.10
ASCII supports unique characters(not including control characters.)
128
Which of the following permissions would allow all users to add, view, and delete files in a directory?
777
Three keystrokes that can initiate a search-and-replace operation in nano are F14, , and .
Ctrl+\ Esc+R
Which keystrokes invoke the pico or nano search function?
F6 Ctrl-W
Only one set (user, group, other) of permission can be changed at once using the symbolic method.
False
The /etc/resolv.conf file tells the computer whether to use DHCP for its network configuration.
False
The RSA key fingerprint allows the dig command to connect to remote systems.
False
The chown command will only accept one file at a time as an argument.
False
The name of the primary wired network devices is ether0
False
The user owner of a file will always have the same or higher permissions as "other".
False
The user sysadmin will be able to read the file because they own it. Part 1: ----r--r-- 1 sysadmin group 38270 Sep 2 18:49 file
False
Unicode is useful for encoding most European languages but not not Asian languages.
False
The free command outputs statistics about:
Memory usage
The chown command can be used to change the user owner on a file by:
Only root
The "execute" permission on a file allows you to:
Run the file as a script
Which of the following protocols defines how network communication functions?
TCP/IP
The chmod command can be used on a file by:
The file owner and root
Each user belongs to at least one group.
True
One way to install new software on a Linux system is to use a package management system.
True
The chown command can be used to change the owner and group of a file.
True
The process (ps) command shows only processes running in the current shell by default.
True
The user sysadmin will be able to change the permissions of the file because they own it. Part 1: ----r--r-- 1 sysadmin group 38270 Sep 2 18:49 file
True
The useradd command will create a home directory by default for a user.
True
When you execute the dmesg command, the system displays messages that are generated by the kernel.
True
How would you finish your script with an exit code of 42?
exit 42
A(n) is a program or system configuration that blocks or enables network access to, from, or through a computer based on the criteria that you specify
firewall
Which of the following commands will display the group(s) a user belongs to?
id
Which of the following commands will display your machine's IP address?
ifconfig
An alternative to the route command to display default routes on some Linux distributions is
ip route show
Which command can be used to determine a user's most recent log in?
last
Which are appropriate editors for writing shell scripts? (choose two)
nano vi
Octal notation uses the following values for the permissions granted:
r = 4, w = 2, x = 1
Which shell command accepts input from the user's keyboard?
read
Which of the following commands will display the routing table? (choose two)
route netstat -r
Which of the following are package management commands for distributions with software distributed in files ending in .rpm? (choose three)
rpm yum yumex
To get a list of all packages installed on a system using RPM Package Management you can execute:
rpm -qa
Which log file contains messages regarding authentication and authorization?
secure
Which of the following commands will allow you to log into a remote machine?
ssh
Which of the following commands will allow you to log into the machine server1 with the account name nick?
ssh nick@server1
A network packet contains ... (choose two)
the IP address of the destination machine. ...the IP address of the source machine.
A command that will continuously update statistics about running processes:
top
For which type of file is nano least likely to be useful for examining or editing?
A LibreOffice word processing document
Which of the following would be considered a host?
A printer attached to the network via an IP address
You want to set up a computer on a local network via a static TCP/IP configuration, but you lack a gateway address. Which of the following is true
You'll be able to communicate with machines on your local network segment but not with other systems.
To save a file and exit the vi text editor in command mode, type
ZZ
Which of the following commands sets "other" permissions on file to r-x?
chmod 775 file
The visudo command uses which text editor by default?
vi
Which of the following commands will display how long the system has been running since the last boot? (choose two)
w uptime
Which of the following are correct about for and while loops? (choose two
while loops have a test each cycle to determine if it should run again for loops operate over a fixed list of items