Endterm OS
Which option for the usermod command can be used to specify a user's group ID (either primary or secondary)?(choose two)
-G -g
The usermod command can be used to unlock a users account with the following option.
-U
Which option for the cut command is used to specify a delimiter?
-d
Which option for the cut command is used to specify the field?
-f
Which of the following options for the useradd command allows you to use a different primary group then the default?
-g
Which option for the usermod command can be used to specify a user's primary group ID?
-g
Which option for the wc command will print the number of lines in a file?
-l
What option to the netstat command has information shown as numbers rather than names?
-n
Which option of the head command will display only the first five lines of a file?
-n 5
Which of the following options for the useradd command allows you to use a different login shell than the default?
-s
Which of the following options for the useradd command allows root to specify supplementary groups the user will be a member of?
-u
Which of the following options for the useradd command allows root to specify the UID to be associated with the account?
-u
Which option for the wc command will print the total number of words in a file?
-w
A service is...
...a feature provided by one computer to another.
The setuid permission...
...allows a command to be run as the file owner.
The setgid permission... (choose two)
...allows a command to be run as the group owner of the file. ...allows files created in a directory to be owned by the group that owns the directory.
The userdel -r command will...
...automatically delete a user and the user's home directory and mail spool and their contents.
The sudo command allows regular users to...
...execute commands as another user.
If a user is deleted, the files and directories that the user owned...
...may be important for others in the organization * ...will show a UID as the owner, but not user name.
The sticky bit permission...
...prevents others from removing files they don't own from a common directory.
A pipe allows you to...
...send the output of one command to another.
When issuing the service network restart command, which of the following occurs?
...takes down all network interfaces, re-reads all related configuration files and then the networking for the system is restarted.
A network packet contains ...(choose two)
...the IP address of the source machine. ...the IP address of the destination machine.
The grep command...
...will display all the lines in a file containing the specified Regular Expression.
Setting setgid on a directory...
...will set the group owner of all files created in the directory to the group owner of the directory.
Which directory is the root of the filesystem?
/
Which of the following is the valid device file name for the first IDE hard drive on the system?
/dev/hda
Which of the following files contains group IDs?
/etc/group
Which of the following files does the groupadd command use to determine the new GID when a GID isn't specified?
/etc/group
Which of the following files contains user IDs?
/etc/passwd
Which files contain user account information? (choose two)
/etc/passwd /etc/shadow
Which of the following files contains the IP addresses of the name servers the system should consult in any attempt to resolve names to IP addresses?
/etc/resolv.conf
Which of the following files contains encrypted user password information?
/etc/shadow
Which files contain user account information?(choose two)
/etc/shadow /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 a user's home directory?
/home
Which file contains the information passed to the kernel at boot time?
/proc/cmdline
The Linux kernel mounts the following pseudo-filesystems to provide access to information about hardware devices connected to the system: (choose two)
/sys /proc
Which of the following directories are designed as locations where any user can create a temporary file? (choose two)
/tmp /var/tmp
What directory typically contains log files?
/var/log
The if command looks for what exit code to consider a condition to be true?
0
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 15 minute 5 minute
What is the meaning of $(( $i + 1)) ?
1 will be added to the i variable
Traditional UNIX systems allowed users to belong to how many groups?
16
Which of the following are valid IPv4 addresses?(choose two)
192.105.10.10 10.33.55.77
Which of the following are valid CPU types for Intel-based platforms?(choose two)
64-bit 32-bit
Which of the following permissions would allow all users to add, view, and delete files in a directory?
777
Which of the following would be considered a host?
A printer attached to the network via an IP address
What is the correct way to assign the word "Hello" to a variable?
A="Hello"
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 last command displays reboot records...
By default
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 read permission to successfully perform ls -l Along with write permission to successfully create new files
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 mkd ir $FOO f i
Creates /tmp/foo if it does not exist
Software that allows hardware devices to communicate with the installed operating system is called?
Drivers
A load average of 1.0 always means the system is fully loaded. True or False?
False
A source file and a symbolic link must be part of the same file system. True or False?
False
A user cannot delete a file if they do not own it. True or False?
False
All Linux systems allow administrators to log in as root. True or False?
False
All log files contain only text data. True or False?
False
Deleting a source file will break an associated hard link. True or False?
False
File permissions cannot be edited by the root user. True or False?
False
For root users, the passwd command can only be used to change the password of the user running the command. True or False?
False
On a system that does not use UPG, the useradd command will also create a user group. For example, user bob, group bob.True or False?
False
On a system that uses UPG, the UID must not be the same as the GID.. True or False?
False
Only one set (user, group, other) of permission can be changed at once using the symbolic method. True or False?
False
Only servers have hostnames. True or False?
False
The /etc/passwd file contains encrypted user password information. True or False? True or False?
False
The /etc/shadow file contains plain-text passwords. True or False?
False
The RSA key fingerprint allows the dig command to connect to remote systems. True or False?
False
The chown command permits changing group ownership done by root only. True or False?
False
The command echo "text" > file.txt will not overwrite file.txt if it already exists. True or False?
False
The groupdel command can be used to delete primary groups. True or False?
False
The groupmod command can be used to add users to a group. True or False?
False
The groupmod command cannot be used to change a group GID. True or False?
False
The user owner of a file will always have the same or higher permissions as "other". True or False?
False
The user sysadmin will be able to read a file because they own it. True or False?
False
Usernames cannot be the same as group names. True or False?
False
When looking at the primary IPv4 configuration file, if the device was configured to be a DHCP client, then the BOOTPROTO value would be set to none. True or False?
False
value of 0 in the "minimum" password aging field means the user cannot change their password. True or False?
False
What does the acronym FHS stand for among the the standards supported by the Linux Foundation?
Filesystem Hierarchy Standard
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
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 are the advantages of solid state disks when compared to traditional spinning platter hard disks?(choose three)
Low power consumption Faster system boot times Less heat
Which of the following are valid partitioning types?(choose two)
MBR GPT
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
Which of the following are common busing systems? (choose two)
PCI USB
The execute permission on a file allows you to:
Run the file as a script
A file begins with #!/bin/csh. This means:
Running the script will invoke /bin/csh to interpret the rest of the file
Channel 2 is
STDERR
Channel 2 is:
STDERR
Error messages generated by commands are sent where by default?
STDERR
UIDs 1-499 are usually reserved for what kind of users?
System accounts, such as server processes
What would an account with the UID 376 typically be used for?
System service access.
GIDs under 500 (or 1000) are usually reserved for what kind of groups?
System use
Which of the following protocols defines how network communication functions?
TCP/IP
The chgrp command can be used on a file by:
The file owner and root
The chmod command can be used on a file by:
The file owner and root
What information is held inside $? ?
The previous command's exit code
What is the default user for the su command?
The root user
Which user can view the /etc/shadow file?
The root user
64 bit platforms can access more memory than 32 bit platforms. True or False?
True
A GID is associated with a group name. True or False?
True
A source and a hard link must be part of the same filesystem. True or False?
True
A successful command may, or may not print output to STDOUT. True or False?
True
Deleting a source file will break an associated symbolic link. True or False?
True
Each user belongs to at least one group. True or False?
True
Each user belongs to at least one group. True or False?
True
For non-root users, the passwd command can only be used to change the password of the user running the command. True or False?
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 or False?
True
Information about the init process can be found in the /proc/1 directory. True or False?
True
Sudo privileges allow users to execute commands as another user. True or False?
True
Sudo privileges can be used to specify which user can use the sudo command to execute commands as other users. True or False?
True
The "Epoch" began on January 1, 1970. True or False?
True
The /proc directory contains a subdirectory for each process present on the system. True or False?
True
The /tmp directory is a temporary directory designed as a location where any user can create a temporary file. True or False?
True
The /var directory has files that change over time. True or False?
True
The chown command can be used to change the owner and group of a file. True or False?
True
The command echo "text" > file.txt will create file.txt if it does not already exist. True or False?
True
The command echo "text" >> file.txt will not overwrite file.txt if it already exists. True or False?
True
The execute permission is never set on files by default. True or False?
True
The fdisk command is a tool used for working with the MBR partitioned disks. True or False?
True
The grep command can be used with glob characters.True or False?
True
The groupmod command can be used to change a group GID. True or False?
True
The groupmod command can be used to change a group name. True or False?
True
The process (ps) command shows only processes running in the current shell by default. True or False?
True
The sbin directories are primarily intended to be used by the root user. True or False?
True
The user sysadmin will be able to change the permissions of a file because they own it. True or False?
True
The/etc/shadow file contains encrypted passwords. True or False?
True
When using the sudo command to execute a command as the root user, the command prompts for the user's own password, not that of the root user. True or False?
True
When you execute the dmesg command, the system displays messages that are generated by the kernel. True or False?
True
Which of the following are valid video cable connector types?(choose two)
VGA DVI
Choose all of the following statements that are true in regard to virtual RAM: (choose three)
Virtual RAM is also called swap space Virtual RAM is stored on a hard drive Virtual RAM is used when available physical RAM is low.
Which of the following is a valid Linux option style for Traditional Unix:
a single dash (-)
Which of the following commands will display CPU information?(choose two)
arch lscpu
A conditional that lets you make multiple comparisons with a pattern is called:
case
Which command(s) can be used to sort the lines of list.file alphabetically and display it on the screen?(choose two)
cat list.file | sort * sort < list.file
Which of the following commands will set the sticky bit on /shared ?
chmod 1777 /shared
Which of the following commands will set setgid on /shared ?
chmod 2777 /shared
Which of the following commands will set setuid for the /usr/bin/program?
chmod 4755 /usr/bin/program
Which of the following commands sets the other permissions on a file to r-x?
chmod 775 file
Which of the following commands set the other permissions on a file to r-x?
chmod o=rx file
Which of the following chown commands will change the myFile user ownership to the user sam and the group ownership to administrators?(choose two)
chown sam.administrators myFile chown sam:administrators myFile
Which of the following long listings represents setgid set for /shared ?
drwxrwsrwx. 12 root group 4096 Oct 21 13:12 /shared
Which of the following commands will append its output to output.file?
echo Testing >> output.file
Which of the following commands will display lines that contain either start or end?
egrep 'start|end' file.txt
How would you finish your script with an exit code of 42?
exit 42
Which of the following commands will check hard disk MBR partitions?(choose three)
fdisk sfdisk cfdisk
Which command can be used to view the /etc/passwd file entries?
getent
Which of the following commands will display only lines that begin with start?
grep ^start file.txt
Which of the following commands will display only lines that begin with test?
grep ^test file.txt
The /etc/group file follows what structure?
group_name:password_placehoder:GID:user_list
Which of the following commands can be used to modify a group?
groupmod
To display the group(s) a user belongs to, use this command:
id
Which command will display the UID, GID and groups your current user belongs to?
id
Which of the following commands will display the group(s) a user belongs to?
id
Which command is used to display only the user's primary group?
id -g
Which of the following commands will display the groups that the user bob belongs to?
id bob
Which command will display the groups that the root user belongs to?
id root
Which of the following commands will display the IP address on a Linux system?
ifconfig
The logging daemon on recent Linux distributions based on systemd is called:
journald
Which command can be used to determine a user's most recent log in?
last
Which command can be used to view the /var/log/wtmp file entries?
last
Which of the following commands would create a symbolic link, link to file?
ln -s file link
Which of the following commands would create a hard link, link to file?
ln file link
Which of the following commands will list hidden files as well as their ownership?
ls -la
Which of the following ls commands, when executed, will only show information about the directory itself? (choose two)
ls -ld ls -d
Which of the following commands will direct error messages to the file, error.log?
ls /root 2> error.log
Which of the following commands can be used to scroll through a text file? (choose two)
more less
Which of the following commands can be used to scroll through a text file?(choose two)
more less
Which command can be used to print line numbers?
nl
Which of the following are methods for setting permissions using the chmod command? (choose two)
octal symbolic
A division of a hard drive may be referred to as a _______ .
partition
Given the following script: whil e [ ! -f /tmp/ f oo ] ; do echo -n "." p r oce ss_data > / tmp/ f oo 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 view all processes on the system?(choose two)
ps aux * ps -ef
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 log file contains messages regarding authentication and authorization?
secure
Which of the following commands will check hard disk GPT partitions?(choose three)
sgdisk gdisk cgdisk
Which of the following commands can be used to display socket statistics, and supports all major packet and socket types?
ss
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
Which command would allow a user to execute commands as root?
sudo
Which of the following are methods for setting permissions using the chmod command?(choose two)
symbolic octal
The number of users logged in is in a variable called USERS. How would you test to see if there are 5 users 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
A command that will continuously update statistics about running processes:
top
Which of the following commands will display how long the system has been running since the last boot? (choose two)
uptime w
Which command allows you to view or change some of the default values used by the useradd command?
useradd -D
Which of the following commands can be used to modify a user?
usermod
Which of the following commands, run as root, will prevent the user bob from logging in?
usermod -L bob
Which of the following commands, run as root, will prevent the user jane from logging in?
usermod -L jane
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
Which of the following commands will add the group extra to the user jane's secondary groups in addition to jane's current secondary groups?
usermod -aG extra jane
Which are appropriate editors for writing shell scripts?(choose two)
vi nano
The first line of this command displays how long the system has been running since being rebooted.
w
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
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
Which command will display the users that are currently logged in to the system?
who