Test Questions Flashcards
Linux and Open Source OS/ VM OS
True or False? You’ve typed rmdir junk to delete the junk directory, but this command has failed because junk contains word processing files. To do the job, you type rm -r junk.
True
If you were a LInux system’s administrator and wanted to see who is currently logged into the computer and what programs they are currently running, you can type the ____ command.
a. w
b. whoami
c. uid
d. u
w
Which of the following redirection operators appends a program’s standard output to an existing filem without overwriting that file’s original contents?
a.»_space;
b. |
c. 2>
d. &>
e. >
> >
Which file now stores kusers passwords in the Linux OS?
a. /etc/passwd
b. /etc/groups
c. /etc/shadow
d. /etc/user
/etc/shadow
True or False: The regular expression
Linu[&c.circ;x].*lds
matches the string, Linux Torvalds.
True
If you wanted to run/execute a script called
my-script
, what could you tupe in the Linux terminal shell to accomplish this?
a. grep a+x ./myscript
b. apt-get a+x ./myscript
c. chmod a+x ./my-script
d. su a+x myscript
chmod a+x ./my-script
Which single keyboard character represents any single character except in a new line in a regular expression in Linux?
a. .
b. !
c. $
d. #
.
Which of the following commands would you type to rename a file called newfile.txt to afile.txt?
a. mv newfile.txt afile.txt
b. touch newfile.txt afile.txt
c. rn newfile.txt afile.txt
d. cp newfile.txt afile.txt
mv newfile.txt afile.txt
You work as a Network Administrator for a company, and they have a Linux based network. You have created a script named if.cgi. You want to provide the following permissions on it:
rwsr-sr–
a. chmod 6754
b. chmod 2754
c. chmod 4754
d. chmod 7754
chmod 6754
Which of the following are the two major Linux package management systems?
a. RPM
b. BASH
c. DPKG
d. TAR
RPM & DPKG
Using the image below, what does the x character represent?
roman x 1025:100::/home/roman:/bin/bash
a. An un-encrypted password stored in the /etc/shadow file.
b. An encrypted password stored in the /etc/passwd file.
c. An encrypted password stored in the /etc/shadow file.
d. An account with no password set.
An encrypted password stored in the /etc/shadow file.
You want to copy a directory, MyFiles, to a USB flash drive that uses the FAT filesystem. The contents of MyFiles are as follows:
$ |s -| MyFiles/
total 276
-rw-r–r– 1 jen users 129840 Nov 8 15:13 contract.odt
-rw-r–r– 1 rod users 42667 Nov 8 15:12 outline.pdf
-rw-r–r– 1 sam users 105979 Nov 8 15:12 Outline.PDF
The USB flash drive is mounted at /media/usb, and so you type cp -a MyFiles/ /media/usb. What problem will occur when you attempt to copy these files?
a. One file will be missing on the USB flash drive.
b. Everything will be fine; the command will work correctly.
c. One file name will be changed during the copy.
d. The command will fail because it tries to create links.
e. The MyFiles directory will be copied, but none of its files will be copied.
One file will be missing on the USB flash drive.
Which of the following Linux commands will print lines from the file world.txt that contain matches to “changes” and “changed”?
a. grep change[ds] world.txt
b. tar change[d-s] world.txt
c. find “change’d|s” world.txt
d. cat world.txt changes changed
e. find change[&c.circ;ds] world.txt
grep change[ds] world.txt
To have a script send an email automatically, which command would you use to do this?
a. mail
b. sed
c. awk
d. email
What could you tupe in a Linux command line terminal shell to see a list of all process IDs (PID) on your computer?
a. process
b. ps
c. get pid
d. get rid
ps