IT 1510 Midterm Practice quiz
Where do I find the root of the file system in Linux?
/
Which entry or entries in an /etc/passwd record will prevent a user from logging on to the system? (Choose two.)
/bin/false /sbin/nologin
An interface to system devices that are represented as files in the file system (called 'device files') is found in which of the following directories?
/dev
You need to mount a USB flash drive on your Linux system. Given that your Linux system currently has one SATA hard drive (/dev/sda). What should be the flash drive's device name?
/dev/sdb
Which device name represents the terminal connected to the current process?
/dev/tty0
Which file is used to automatically mount filesystems when the system initially boots?
/etc/fstab
Which configuration file influences the permissions of the user's home directory when creating a user?
/etc/login.defs
In which of the following files is the user's default login shell specified?
/etc/passwd
You want the default editor for all new users to be nano. Which file would you edit?
/etc/skel/.bash_profile
which of the following paths is an absolute path.
/home/hoe/doc1
What is the common mount point?
/mnt
Where are time zone data files stored?
/usr/share/zoneinfo
Which of the following settings for umask ensures that new files have the default permissions -rw-r----- ?
0027
Which of the following will redirect the standard input and standard output to the same file? (Select all that apply.)
2>&1 >& 1>&2
I ran the command touch file with spaces Please enter the number of files created:
3
How many files will be created by the command touch {a..f}?
6
You've used fdisk to create a new MBR partition on the second hard drive in your Linux system. You want to use the partition as a second swap partition for your system. Which partition type do you need to change it to?
82
You've created a new file using vi and now need to save the file without exiting the editor. Which command will do this?
:w
Which commands are associated with local variables?
<variable_name>=<value>
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sde /dev/sdf /dev/sdg Why was this level be chosen for md0?
A cost efficient solution that allows 1 drive to die
What is a CLI or Cui?
A means of interacting with a computer program where the user (or client) issues commands to the program in the form of successive lines of text.
What gives Linux multiple users and groups?
ACL
sudo mount /dev/sda5/
Adds the fifth partition of the sda drive to the root file system
What would you do to fix when the bash shell is no longer storing command history (Select all that apply.)
As a remedial action, turn the history option on. Determine if ~/.bashrc has a statement that turns history off. Determine the current condition of the history option. Determine if /etc/bashrc has a statement that turns history off.
In the vi editor, how can commands such as moving the cursor or copying lines into the buffer be issued multiple times or applied to multiple rows?
By specifying the number right in front of a command such as 4l or 2yj
A user's password expired five days ago. The value of inactive is 0. What can the user do?
Contact the system administrator to reset the account.
Which type of backup backs up all files modified since the last full backup and does not flag the files as having been backed up?
Differential
What does the set command do? student@lintro:~$ set What will happen?
Displays a list of shell options and their status
You're using vi to edit a text file in insert mode. Because of the nature of the changes you're making to the file, you need to switch to replace mode. Which of the following keys will do this? (Choose two.)
ESC R INSERT
Your cursor is positioned at line 14 of the document. Which command or commands will bring your cursor to the top of the document? (Choose two.)
ESC: 1G ESC: GG
Which permission, when applied to a directory in the file system, will allow a user to enter the directory?
Execute
What must you do if you modify settings in the file /etc/locale.conf using the localectl command?
Execute the command . /etc/locale.conf (to source the locale.conf)
With NFSv4 Access Control Lists the first matched Access control entry is the permissions the user gets to the file/directory.
False
Which of the following does NOT happen when a user account is removed from the system?
Files and directories owned by the user are deleted.
I just bought a 5.2 TB hard-drive how should I partition it?
GPT
On a Linux system the file system table file usually uses UUIDs of partitions rather than the representation of the partition as a device file. What is the reason that UUIDs are preferred?
If partitions are added or removed it may change the names of the other device files in the system.
What does the command mount -a do?
It ensures that all file systems listed with the option auto in /etc/fstab are mounted.
What is the purpose of the Filesystem Hierarchy Standard?
It is a distribution neutral description of locations of files and directories.
Instead of supplying an explicit device in /etc/fstab for mounting, what other options may be used to identify the intended partition? (Choose TWO correct answers.)
LABEL UUID
What is ext4?
Latest linux filesystem type
Which of the following pieces of information of an existing file is changed when a hard link pointing to that file is created?
Link count
Who used Richard Stallman's GNU development tools to create a free operating system?
Linus Torvalds
A user's password expired five days ago. The value of inactive is 14. What can the user do?
Log on, but be ready to change their password
You're using vi to edit a file. You are in command mode. You have just searched for the string "nameserver" from the current cursor position toward the bottom of the document. You would like to continue searching for the string "nameserver" but want to reverse the search direction. What command would do this?
N
Assume the directory /fred does not exist and the files error1 and error2 contain content. What will the command ls -ld /etc /fred > error1 2>> error2 do? (Select all that apply.)
Overwrite the content of the file error1.
What raid level is also known as striping?
RAID 0
Which RAID level has the following characteristics? Minimum 3 disks. Good performance ( as blocks are striped ). Good redundancy ( distributed parity ). Best cost effective option providing both performance and redundancy. Use this for DB that is heavily read oriented. Write operations will be slow.
RAID 5
Which RAID level would you use if you wanted to increase reliability and minimize the incremental cost for the reliability.
RAID 5
In the command "cd Documents" Documents is what kind of a path name?
Relative path name
Which of the following is not a common serial storage bus type:?
SCSI
what does the command fuser -c /mnt/newdisk do?
Shows who is using /mnt/newdisk
What do the permissions -rwSr-xr-x mean for a binary file when it is executed as a command?
The execute flag is not set for the owner. Therefore the SetUID flag is ignored.
You have removed the user records for student3 in /etc/passwd and /etc/shadow but did not remove the home directory, cron jobs, at jobs, and mail associated with student3. What command will do this?
The files must be removed manually.
Creating a hard link to an ordinary file returns an error. What could be the reason for this?
The source and the target are on different filesystems.
What is true regarding the command userdel --force --remove bob? (Choose TWO correct answers.)
The user bob is removed from the system's user database The user bob's home directory is removed.
After opening a file, you use the arrow keys to move the cursor to the line you want to edit. You try to type, but nothing happens. Why?
The vi editor is in command mode. You need to switch to insert mode.
The Linux system's umask variable is currently set to a value of 077. A user named jcarr (who is a member of the staff group) creates a file named mythoughts.odt. What can users who are members of the staff group do with this file?
They have no access to the file at all.
A user with a user ID of 3 has an asterisk in their password field in /etc/shadow. What does this indicate?
This is a system account and does not require a password.
The purpose of the /etc/shadow file is ____________.
To hold the encrypted user passwords
student@debian:~$ sudo -l [sudo] password for student: Matching Defaults entries for student on this host: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin User student may run the following commands on this host: (ALL : ALL) ALL Given the above does student have the permissions to shutdown the machine with the sudo command?
True
Which file system definition method allows you to change the storage device order or change cabling?
UUID
Which of the following does not require root powers?
Viewing all users on the system
What is true regarding the file ~/.forward?
When configured correctly, ~/.forward can be used to forward each incoming mail to more than one other recipient.
Which systems can use Fat32/VFAT?
Windows 7, Windows 8, Windows 98, Windows ME, Windows Vista, Linux
Which of these is not a step to manually add a user?
adduser
A new employee has come into the company, how do I set up an account for him using one command?
adduser joe
Which two character command would I use to go to another directory?
cd
If I enter the command cd ~ what will happen?
change to the current users home directory
What does the command cd~ do?
changes to the users home directory
Which of the following commands is used to make a file immutable?
chattr +i <filename>
What command do I use to change GECOS information?
chfn
The admin group needs to be able to execute and change the adminSetup script. Which commands would work to do this
chgrp admin adminSetup chmod g+xwr
Which of the following commands will change the group of a file named report.doc from group student to group research?
chgrp research report.doc
You need to change the permissions of a file named schedule.odt so that the file owner can edit the file, users who are members of the group that owns the file can edit it, and users who are not owners and don't belong to the owning group can view it but not modify it. Which command will do this?
chmod 664 schedule.odt
I want to have the user able to read the filename and the group access to execute the file, what command should I use?
chmod u+r,g+x filename
Fred has taken over for Bill at work and so all Bill's files need to be given to Fred. What command would transfer control of the files to Fred.
chown fred *
Which of the following commands will change the owner of a file named report.doc from user jane to user john?
chown john report.doc
In trouble shooting the cmd command which symbols would be used to send the error and the outputs to a file?
cmd &> file
Which mode does vi open in by default?
command mode
What command will generate a list of user names from /etc/passwd along with their login shell?
cut -d: -f1,7 /etc/passwd
Which commands will display the current system time zone? (Select ALL that apply.)
date date +%Z timedatectl ls -l /etc/localtime
Which command can be used to create an image of the /dev/sda2 partition in the /mnt/usb/volback file?
dd if=/dev/sda2 of=/mnt/usb/volback
Which command will remove the group named developers from the system?
delgroup developers
What two letter command indicates if the drive is too full?
df
Which command would I use to see if I have enough disk space?
df
What command should I use to see if there is sufficient space for log files?
df -h
Which command will provide you with a summary of inode consumption on your /dev/sda2 partition?
df -i
What are two ways to find the absolute address of the ~ directory? (SELECT TWO ANSWERS)
echo ~ cd ~ then pwd
Which of the following sequences in the vi editor saves the opened document and exits the editor? (Choose TWO correct answers.)
esc ZZ esc: wq!
Which type of filesystem is created by mkfs when it is executed with the block device name only and without any additional parameters?
ext2
A solid state disk that can transfer data a 500MBps is a good match for a SATA II controller
false
A solid state disk that can transfer data a 500MBps is a good match for a SATA II controller?
false
RAID 0 provides fault tolerance such that if one drive fails the other will contain the data?
false
What command would display the content type of a file?
file
Which of the following commands will NOT update the modify timestamp on the file /tmp/myfile.txt?
file /tmp/myfile.txt
What commands would find files filea, fileb, and filec in student1's home directory and remove them, but require confirmation before removing them? (Select two.)
find /student1 -name "file[a-c] -ok rm {} \; find /student1 -name "file[a-c] | xargs -p rm
What is fsck used for?
fsck is used to check and repair Linux file systems.
What will the command 'chmod u+x filename' do?
give execute permission for the user irrespective of anything else
I have run the commands: sudo useradd fred sudo passwd fred so fred has a password and a valid login name. Do I need to do something else?
give fred a home directory
Which commands will display the user record for student1 or root from the file /etc/passwd? (Select three.)
grep '^student1\|^root' /etc/passwd; grep -E '^student1|^root' /etc/passwd; egrep '^student1|^root' /etc/passwd
Which commands will display all strings with two occurrences of a lowercase o (oo)? (Select three.)
grep 'o\{2\}' grep -E 'o{2}' egrep o{2}
I found a /dev/sda1 on my linux system what is it?
hard drive
What is hidden in /etc/shadow?
hash codes
I want to tweak the disks for maximum speed. What low-level tool to view and sets disk and interface parameters should I use?
hdparm
Which command would I use to lower the power to a hard disk drive to increase battery life on my laptop?
hdparm -B 1
Which commands would display the first ten lines of the file /etc/passwd? (Select two.)
head /etc/passwd head -10 /etc/passwd
What is the difference between the i and a commands of the vi editor?
i (insert) inserts text before the current cursor position whereas a (append) inserts text after the cursor.
What command would create a file that shares the same inode as filea?
in filea fileb
What happens to the EUID when the setuid property of the file is configured?
it is the UID of the owner of the file
What system is most likely to be trusted to provide logon authentication for the Access Control to your linux system?
kerberos
Which command does more, more or less?
less does more
Which command shows the files in the directory?
ls
which command shows the files in the directory
ls
What command would produce this output? . .gksu.lock .pulse .. .gnome2 .pulse-cookie .bash_history .gnome2_private secret .bash_logout .gstreamer-0.10 Templates .bashrc .gtk-bookmarks test bin .gvfs The secret voice in your head.mp3 .cache .ICEauthority .thumbnails .config .local varlogoutfile.txt .dbus .mission-control Videos Desktop .mozilla vmware-tools-distrib Documents Music .xsession-errors Downloads Pictures .xsession-errors.old .fontconfig .profile
ls -a
student@debian:~$ ls -l total 356 -rw-rwxr-- 1 student hobbits 0 Oct 2 15:32 a drwxr-xr-x 2 student student 4096 Jun 4 2014 bin -rw-r--r-- 1 student student 304343 Oct 2 15:09 catview drwxr-xr-x 2 student student 4096 Dec 4 2013 Desktop drwxr-xr-x 2 student student 4096 Jan 20 2015 Documents drwxr-xr-x 2 student student 4096 Feb 10 2015 Downloads I need to remove the total line from the ls command, how could I filter this line out?
ls -l| grep -v total
You would like to get a directory listing of the current directory and save the results to a file name files.txt. Which command would accomplish the task?
ls > files.txt
Which commands will extend a logical volume filesystem from 500MB to 1000MB? (Choose two.)
lvextend -L 1000M /dev/lvm1 lvextend -L +500M /dev/lvm1
I can't remember what the command in linux to work with USB drives and I can't get on the internet. What should I do?
man -k usb
Which command is used in a Linux environment to create a new directory? (Specify ONLY the command without any path or parameters.)
mkdir
Which command is used to create a directory?
mkdir
Which of the following commands will list the file systems that are currently mounted?
mount
You created an ext4 filesystem on the first partition on the second SCSI hard disk in your system and now need to mount it in /mnt/extraspace in read-write mode. Which commands will do this? (Choose two.)
mount -t ext4 /dev/sdb1 /mnt/extraspace/ mount -a /dev/sdb1 /mnt/extraspace/
You need to mount an optical disc in /media/dvd. Which command will do this?
mount -t iso9660 /dev/cdrom /media/dvd
What commands do you use to mount/unmount filesystems to a mount point?
mount and umount
The command "cd ../../.." does what?
move 3 directories up the tree
The file requires the ability to set permission to change file ownership without giving sudo permission which command should be used?
nfs4_setfacl
The file error1 exists in the current directory, but when a user attempts to redirect the output of a command to the file, they receive the message "cannot overwrite an existing file." What is the cause of and fix to this problem?
noclobber is turned on and it must be turned off using set +o noclobber
Which of the following is NOT a linux text editor we used in class?
notepad
Which colors will be ELIMINATED by running the following line (You may choose more than one answers) cat colors|grep -iv orange
orange burnt orange
Which files are affected by the command: sudo adduser barack obama?
passwd, shadow, group, gshadow, /home/barack
Which rule would help the most for keeping passwords secure?
passwords must be longer than 8 characters
After adding a third 1TB solid state drive (SSD) to a Linux server, it needs to be added as storage space to an LVM volume group named DATA on the system. Which command should be entered first to do this?
pvcreate /dev/sdc
The command wc -l <filename> will count the number of lines in a file. You execute the commands wc -l /etc/passwd and wc -l /etc/shadow. You find you have an extra record (line) in /etc/shadow. What command will fix this?
pwconv
A user needs to open a file, edit it, and then save the changes. What permissions does he need in order to do this? (Choose two.)
read write
What will the following command do? head < file8 > file9
read the first 10 lines from file8 and copy them to file9
The command "rm *" would do what?
remove all files in the current working directory
I have added a new scsi drive to the system, what command will tell the operating system I have plugged in a new drive?
rescan-scsi-bus
Which order would best work for these commands?
rescan-scsi-bus, cfdisk /dev/sdd, mkfs.ext4 /dev/sdd1, mkdir /mnt/storage1, mount /dev/sdd1 /mnt/storage1
What command is used to delete files?
rm
Which of the following commands will remove the directory named temp?
rmdir temp
Which command would be used to create a posix access control list?
setfacl -d -m group:toolies:r-x dir
The user named student just used a wget to get bill's tar file. If the student extracts the file using the tar xf command to ~ who will be the owner of the file?
student
what command is used to gain rootly powers?
sudo
The following line was found in the sudoers file %wheel ALL=(ALL) ALL What command could give user bilbo sudo permissions?
sudo adduser bilbo wheel
Which command will add user jane to the group developers?
sudo adduser jane developers
fred needs his password fixed what command should I use to reset his password?
sudo passwd fred
New backup technicians have been hired. What commands could be used to give them root privileges to a limited set of backup commands?
sudo visudo
To make changes to the sudoers file what command should I use?
sudo visudo
What happens if the password of a user in the /etc/shadow file is prepended with the ! character?
the password becomes invalid which disables password based logins although other login methods remain usable
Which of the following commands will reduce all consecutive spaces down to a single space?
tr -s ' ' < a.txt > b.txt
How do you add journaling to ext2 making it ext3?
tune2fs -j /dev/sda1
Which command is used to set restrictions on the size of a core file that is created for a user when a program crashes?
ulimit
What does the command fsck /dev/sda1 do?
used to check the state of and repair a file system
Which of the following is not a valid Linux filename?
user one
Which of the following information is NOT found in the /etc/passwd file?
user password
You are adding a user. The value stored in the variable USERGROUPS_ENAB in /etc/login.defs is yes. You do not wish to create a new group, but want the user's primary group to be the same as the value (100) stored in the GROUP variable in /etc/default/useradd. Which of the following commands would accomplish this? (Choose two.)
useradd -g 100 <username> useradd -n <username>
You are changing the logon name for user student1 to student3. What is the appropriate command?
usermod -l student3 -d /home/student3 -m student1
What happens after issuing the command vi without any additional parameters?
vi starts in command mode and opens a new empty file.
An administrator wants to copy paste users and passwords between different linux servers. What command would allow him to best do this?
vipw
What is a small computer program which enables a Unix system administrator to comfortably edit the "passwd" and "Shadow password" files?
vipw
What command should be used to control the powers granted by the sudo command?
visudo
The current ifconfig command needs to be fixed, how can its directory be found?
which iconfig
A machine has 2 different ls commands on it, how can you tell which command will be run?
which ls
You are logged in as student1. You execute the command su student2. What command or commands will display who you have logged on to the system as? (Choose two.)
who w
Which command will compress files by default?
xz
In the vi editor, which of the following commands will copy the current line into the vi buffer?
yy