· 8 years ago · Apr 10, 2018, 06:32 PM
11) What is the file that stores encrypted group passwords in Linux?
2D. /etc/gshadow
3
42) Given the following at command line:
5user@localhost:~$ grep user1 /etc/passwd
6user@localhost:~$ user1:x:1001:1001: :/home/user1:/bin/bash
7What is the default login shell for user1?
8B. /bin/bash
9
103) Login as user1, the command used to change the login shell to /bin/sh
11___________________
12C. chsh -s /bin/sh
13
144) Which of the following commands will delete user1 account and user1's home directory?
15A. userdel –r user1
16
175) Which of the following commands can be used to verify if user1 has been deleted in the system?
18C. grep user1 /etc/passwd
19
206) Login as root, to create a user account based on the following:
21Username: user2
22Home directory: /home/user2home (Create user’s home directory if it doesn’t exist)
23Default login shell: /bin/bash
24What is the command that should be used?
25D. useradd -d /home/user2home –m –s /bin/bash user2
26
277) If user3 is a valid account and the home directory is /home/user3, the command usermod -d /home/user3home user3 will_____________
28D. Only change the home directory of user3 in /etc/passwd
29
308) Identify the command that is used to delete a group in Linux?
31B. groupdel
32
33Login as root, run the following commands and answer question 9 to 13:
34groupadd group1
35groupadd group2
36useradd user1
37useradd -G group1,group2 user2
38useradd -g group1 -G group2 user3
39useradd -g user2 –G group1,group2 user4
40gpasswd -a user1 group1
41gpasswd -d user4 group1
42usermod –G group1 user1
43groups user4
44
459) Who are a member of group1?
46C. user1, user2 and user3
47
4810) Who are a member of group2?
49C. user2, user3 and user4
50
5111) who are a member of group user2?
52D. user2 and user4
53
5412) What is the initial group of user3?
55C. group1
56
5713) What is the output produced by command: groups user4?
58B. user2 and group2
59
6014) To make user4 the administrator of group1, you login as root and type_____________.
61C. gpasswd -A user4 group1
62
6315) The command that will remove all files that begin with a number in current directory
64______________________.
65B. rm [0-9]*
66
6716) The command that will set SGID for /public in Linux ________________?
68C. chmod g+s /public
69
7017) Which of the following uses the bash shell as the command interpreter in a script?
71D. #!/bin/bash
72
7318) What special variable is used to determine the exit status of a previously executed command?
74C. $?
75
7619) You use the ___________ symbol to mark the beginning of a comment in a shell script.
77A. #
78
7920) To throw away both standard output and standard errors of script1, use _______________ command.
80C. script1 &> /dev/null
81
8221) _________________ is the operator that is used when you want one command to execute only if the preceding command succeeds.
83C. &&
84
8522) What is the output of the following statement?
86echo ‘\$pwd’
87D. \$pwd
88
89
9023) echo “This is my ‘test’â€
91C. This is my ‘test’
92
9324) The command find -user root would search for ______________________.
94A. files that are owned by root in current directory.
95
96Answer question 25 to 29 based on the following array:
97cst8102=(test1:15% test2:15% final:30% labs:30% online:10%)
98
9925) What is the output of the following command?
100echo ${cst8102[1+3]}
101E. online:10%
102
10326) What is the output of the following command?
104echo ${#cst8102[*]}
105B. 5
106
10727) What is the output of the following command?
108echo ${#cst8102[2]}
109D. 9
110
11128) What is the output of the following command?
112echo ${cst8102[*]}
113A. test1:15% test2:15% final:30% labs:30% online:10%
114
11529) What is the output of the following command?
116echo ${cst8102[0]}|cut –d: -f2
117B. 15%
118
11930) Given the output of command “ls –l fileone†as the following:
120-rw-r--r-- 1 steven users 126 2013-11-25 12:50 fileone
121What is the output of the following statement?
122echo “$(ls –l fileone|cut –d††–f3)â€
123B. steven
124
12531) What is the output of the following statements?
126a=30;b=20
127{ a=40;b=30; }
128(a=10;b=20)
129echo $a $b
130D. 40 30
131
13232) The following echo statement will execute _______________ time(s).
133for ((num=1; num<7; num++ ))
134do
135echo $num
136done
137
138C. 6
139
14033) What is the result of executing the following statements?
141for num in {1..7..2}
142do
143echo $num
144done
145
146C. 1, 3, 5, 7 are displayed on the screen on separate lines
147
14834) The following echo statement will execute _________time(s).
149((a=10))
150until [ $a -ge 5 ] && [ $a –le 10 ]
151do
152echo “Blue ocean!â€
153((a++))
154done
155A. 0
156
15735) What value of the variable name total will be displayed after executing the following statements?
158((total=0))
159for ((num1=1; num1<5; num1++))
160do
161for ((num2=1; num2<=4; num2++))
162do
163for ((num3=3; num3>1; num3--))
164do
165((total++))
166done
167done
168done
169echo $total
170
171A. 32
172
17336) What is the result of executing the following statements?
174((g=10))
175while [ $g –ge 5 ]
176do
177((g--))
178echo $g
179done
180
181B. The numbers 9, 8, 7, 6, 5, 4 are displayed on the screen on separate lines
182
18337) What value of the variable name c will be displayed after executing the following statements?
184((x=1))
185((c=0))
186while [ $x –lt 5 ]
187do
188((y=4))
189until [ $y –le 1 ]
190do
191((y--))
192echo $x $y
193((c++))
194done
195((x++))
196done
197echo “The number of times looped is: “ $c
198
199B. 12
200
20138) What is the result of executing the following statements?
202((x=10))
203echo $x
204function function1 ()
205{
206local x=20
207echo $x
208}
209((x=x+5))
210echo $x
211function1
212((x=x+10))
213echo $x
214
215A. The numbers 10, 15, 20, 25 are displayed on the screen on separate lines
216
21739) What is the output of executing the following script file named display_it?
218#!/bin/bash
219function shownum ()
220{
221echo $1 $2 $3
222}
223shownum $3 $2 $1
224$ display_it 5 10 15
225
226B. 15 10 5
227
22840) A ____________ is a passive entity, such as a file containing a list of instructions stored on disk (often called an executable file). In contrast, a ___________ is an active entity, with a program counter specifying the next instruction to execute and a set of associated resources. A program becomes a process when an executable file is loaded into memory.
229A. program, process
230
23141) The ________________, or CPU scheduler, selects from among the processes that are ready to execute and allocates the CPU to one of them.
232A. short-term scheduler
233
23442) In VIM, to insert the content of a file, you type ___________________
235B. :r filename
236
23743) Typing __________ followed by a phrase searches BACKWARD for the phrase in VIM.
238A. ?
239
24044) The command that will set an option so a search or substitute ignores case in vim __________________.
241D. :ignore case
242
243
244 1. rsyslogd, ftpd, httpd are examples of daemons [X] True [ ] False
245
2462. Who are members of percussion?
247[ ] player1, player2 [ ] player2, player4 [X] player1, player3 [ ] player1, player2, player3
248
2493. Write the command replace a character at the cursors location [X] r [ ] re [ ] rp [ ] R
250
2514. The command "useradd user1" will [ ] give an error [X] create a group called user1 and add a user called user1 in the newly created group [ ] add a user called user1 to the group root [ ] add a user called user1 to the first group on the list
252
2535. Process priority could be changed by using nice
254
2556. A kernel [X] gets loaded into system memory and runs code in kernel space [ ] gets loaded in ROM BIOS and runs from the BIOS [ ] gets loaded from flash memory then gets loaded in BIOS [ ] gets loaded into system memory and runs code in user space
2564/10/2018
2572/34
258
2597. Which one of the following will delete directory /test1 and files stored in it? [ ] rmdir ~/test1 [ ] rm ~/test1 [ ] rmdir -p ~/test1 [ ] rm -r ~/test1 [X] rm -r /test1
260
2618. As a process executes, it changes state. In what state the process is waiting for some event to occur (such as an I/O completion or reception of a signal)? [X] waiting [ ] new [ ] ready [ ] runing
262
2639. The user has set the umask to 022. A directory is created, what will be the file permission. [ ] -----w--w[ ] -rw-r--r-[ ] -rw-rw-rw [X] -rwxr-xr-x [ ] ----rw-rw
264
26510. The command used to find your current shell ________________________. [ ] cat /etc/shells [ ] whoami [ ] PS!="\u@\h: \w$" [X] echo $SHELL
266
26711. To run a binary file a user must have a minumum of [ ] read and execute permission [X] execute permission [ ] write and execute permission
268
26912. What is the command for environment variables to be visible to shell scripts and child processes [ ] ENV [ ] set (variable) [X] export (variable) [ ] env (variable)
270
2714/10/2018
2723/34
27313. _______________________ operating system switches rapidly from one user to the next, each user is given the impression that the entire computer system is dedicated to his use, even though it is being shared among many users. [ ] A multiprogrammed [X] A timeshared [ ] A singleuser [ ] A multiuser
274
27514. user1 is logged in. What is the command to change the default shell for user1 to /bin/dash the next time user1 logs in? [ ] usermod -s /bin/dash user1 [X] none of the above [ ] chsh s /bin/dash [ ] useradd s /bin/dash user1
276
27715. How many primary partitions have been created?
278[X] 2 [ ] 0 [ ] 4 [ ] 3 [ ] 5
279
28016. What would be the output of the pwd command?
281[X] /root/budget [ ] /budget [ ] / [ ] /root
282
28317. Which directory stores log files and administrative files [ ] /lib [ ] /bin [ ] /etc [X] /var [ ] /dev
284
2854/10/2018
2864/34
28718. How many primary partitions have been created?
288[ ] 3 [ ] 4 [X] 1 [ ] 2 [ ] None
289
29019. Identify the command to rename a file in LINUX [ ] rename [X] mv [ ] ren [ ] cp
291
29220. What is the command used to save the changes and quit in vim? [X] :wq [ ] :w [ ] :q [ ] :q!
293
29421. Write the command you will use to paste data from the buffer after cursors location [ ] P [ ] paste [X] p
295
29622. The Linux command that displays all mounted devices __________ [ ] cat /etc/fstab [ ] fdisk -l [X] mount [ ] fsck
297
29823. Kernel space is protected because [ ] user data can be large and will not fit in kernel space [X] an error in an application program is isolated and does not bring down the entire system or make it unstable [ ] user data is confidential and should not be viewed by other users
299
3004/10/2018
3015/34
30224. In bash shell, what is the operation done by double brackets (( ))? [ ] logical evaluation [ ] arithmetic expansion [X] arithmetic evaluation [ ] command substitution [ ] parameter expansion
303
30425. Which of the following command will display all active swap partitions? [ ] swapoff [ ] mkfs [ ] fdisk -l [X] swapon -s
305
30626. Identify the command used to display updating information about the processes running on the system. [ ] ps [X] top [ ] jobs [ ] nice
307
30827. Answer the following question based on the following declaration in bash instruments= (russia:balalaika china:guqin canada:harp india:sitar brazil:berimbau) What is the output of the following command echo ${instruments[2]} [ ] china:guqin [ ] india:sitar [X] canada:harp [ ] brazil:berimbau [ ] russia:balalaika
309
31028. How many maximum extended partitions are allowed in a drive? [X] 1 [ ] 4 [ ] 3 [ ] 5 [ ] 2
311
31229. Identify the Linux command used by root to give everyone full access permission to directory /public. [ ] chmod ugo+rwx /public [ ] chmod ugo=rwx /public [ ] chmod a+rwx /public [ ] none of the above [X] all of the above [ ] chmod 777 /public
313
3144/10/2018
3156/34
31630. What is the output of the command echo "$(pwd)" [ ] The command will give a syntax error [ ] $(pwd) [X] The current working directory will be displayed [ ] pwd
317
31831. What is the first process started by Linux kernel? [ ] bash [X] init [ ] sendmail
319
32032. A CPU services several running processes in round-robin scheduling. To service the next waiting process it saves the state of the current process, then restores the contents of the waiting process. The task of reassigning the CPU from one task to another [ ] memory allocation [X] context switching [ ] multi-tasking [ ] scheduling
321
32233. What is the minimum permission required for the file to copy it? [ ] write [ ] write and execute [X] read [ ] read and execute [ ] read and write
323
32434. The command "gpasswd -d user1 audit" will [ ] will give an error [ ] will make user1 the administrator to group audit [X] will delete user1 from group audit [ ] add user1 to group audit
325
32635. Identify the command that will create a user account with the following specifications. Username: player1 Home Directory: /home/percussion Login Shell: /bin/bash
327[ ] useradd player1 [ ] useradd -h /home/percussion -c /bin/bash player1 [ ] useradd /home/player1 /bin/bash player1 [X] useradd -d /home/percussion -m -s /bin/bash player1
328
3294/10/2018
3307/34
33136. What is the outcome of the command "usermod -G audit woqag"? Which groups will user woqag belong to after this command is run?
332[ ] audit [X] audit, account [ ] audit, finance [ ] audit, account, finance
333
33437. Given the file permission rw-rw-r-- for a file report.draft in current directory, identify the chmod command that adds execute permissions for owner and removes read permission from others. Permission for group should remain unchanged. [ ] chmod 770 report.draft [X] chmod 760 report.draft [ ] chmod 740 report.draft [ ] chmod 750 report.draft
335
33638. What is the key used to switch in between Insert and Normal/command modes in vim? [ ] F1 [ ] ENTER [X] ESC
337
33839. How many times will the echo statement execute when the following script is run? for num in {1..10..3} do echo $num done [ ] 5 [X] 4 [ ] 3 [ ] 0 [ ] 2
339
34040. Typing ___________ followed by a phrase searches FORWARD for the phrase in VIM. [X] / [ ] ? [ ] %
341
34241. Based on the following declaration in bash groups=(audit:2001 finance:2002 account:2003 sales:2004 purchase:2005) What is the output of the following command echo ${groups[1+2]} [ ] finance:2001 [X] sales:2004 [ ] account:2003
3434/10/2018
3448/34
345
34642. To move a file a user must have appropriate permission in the source and target directories, but does not need any permission for the file itself. [ ] False [X] True
347
34843. In bash shell, what is the operation done by a dollar sign and double brackets $(( ))? [ ] logical evaluation [X] arithmetic expansion [ ] parameter expansion [ ] command substitution [ ] arithmetic evaluation
349
35044. You have made changes to a file in vim, you decide not to save the changes and quit. What command will you use? [X] :q! [ ] :exit [ ] :quit [ ] :wq
351
35245. A ____________ a passive entity, such as a file containing a list of instructions stored on disk (often called an executable file). In contrast, a ___________ is an active entity, with a program counter specifying the next instruction to execute and a set [ ] memory, hard disk [ ] virtual memory, physical memory [X] program, process [ ] process, program
353
35446. Write the command you will use to copy one line in the buffer. [ ] cp [X] yy [ ] copy
355
35647. The Linux command that will print the current working directory [ ] cd [ ] ls [X] pwd [ ] mkdir
357
35848. To delete a file a user must have write and execute permission in the directory, but does not need any permission for the file itself. [ ] False [X] True
359
3604/10/2018
3619/34
36249. What is the key combination used to send a process to backgroud? [X] CTRL+Z [ ] CTRL+D [ ] CTRL+C
363
36450. The script shown in the picture will run in
365[ ] kernel mode [X] user mode
366
36751. You can keep your preferred settings by creating a ___________ file in vim. [ ] bashrc [X] vimrc [ ] history [ ] man
368
36952. The command that is used to change directory to test1, a sub-directory of user1’s home directory, /home/user1, given the command prompt listed below: user1@localhost: /etc$ [ ] cd ./test1 [ ] cd home/user1/test1 [ ] cd /test1 [X] cd ../home/user1/test1
370
37153. To enter visual mode to start visual selection, you press __________ in VIM. [ ] p [ ] i [X] v [ ] a
372
37354. Who are the members of account?
374[ ] turoz, woqag [ ] nibeg, turoz [ ] gavop, turoz [X] gavop, woqag
375
3764/10/2018
37710/34
37855. The PID and PPID of init process are __________ and _________ [X] 1 and 0 [ ] 0 and 1 [ ] 1 and 1 [ ] 0 and 0
379
38056. What is the output of the command groups player4
381[ ] player1, player2, player4 [X] player1, player2, player4, wind [ ] player4 [ ] player4, player2
382
38357. To put back text that has just been deleted (paste), type: _______ in vim. [ ] c [ ] u [X] p [ ] r
384
38558. user1 is logged in. What is the command to change the default shell for user1 to /bin/sh the next time user1 logs in? [ ] useradd s /bin/sh user1 [ ] chsh s /bin/sh [X] sudo usermod -s /bin/sh user1 [ ] $SHELL=/bin/sh [ ] usermod -s /bin/sh user1
386
38759. Identify the command that will allow the superuser to delete account and home directory of user2 [X] userdel -r user2 [ ] usermod -r user2 [ ] usermod -d user2 [ ] userdel user2
388
38960. The command that will only search $PATH to locate commands in bash shell _______________. [ ] history [ ] type [ ] whereis [X] which
390
3914/10/2018
39211/34
39361. Given the following at command line: user@localhost: /lab6$ touch aaa cbd bbc bda cdd ab ad user@localhost: /lab6$ ls [a-d]?[!ac] What is the output of the above command? [ ] aaa cdd [ ] bda [X] cbd cdd [ ] bbc
394
39562. What you can do to get help in vim? [ ] type :help (ENTER) [ ] press the (HELP) key (if you have one) [X] All of the above [ ] press the (F1) key (if you have one)
396
39763. Write the command you will use to paste data from the buffer before cursors location. [ ] p [ ] paste [X] P
398
39964. The command "gpasswd -a user1 audit" will [X] add user1 to group audit [ ] delete user1 from group audit [ ] give an error [ ] make user1 the administrator to group audit
400
40165. To execute an external command in VIM, you should ______________ [ ] type :! followed by the command in insert mode [X] type :! followed by the command in command mode [ ] type :! followed by the command in visual mode
402
40366. The command "useradd -g audit user3" will [X] add user3 to group audit [ ] give an error [ ] will make user3 an administrator to group audit
404
40567. The root user wants to change the owner to cfo and group to ExecCmt for file Strategy.Q03. Identify the command that will achieve the result. [ ] chown cfo root Strategy.Q03 [ ] chown Strategy.Q03 cfo root [X] chown cfo.ExecCmt Strategy.Q03 [ ] chgrp Strategy.Q03 cfo ExecCmt [ ] chgrp cfo.ExecCmt Strategy.Q03
406
4074/10/2018
40812/34
40968. Identify the operator that will stream the output of the the first command and send it as input to the second command. [X] | [ ] > [ ] >> [ ] ;
410
41169. Type ___________ to open a line below the cursor and place you in Insert mode in vim. [ ] e [ ] i [ ] a [X] o
412
41370. Answer the following question based on the following declaration in bash instruments= (russia:balalaika china:guqin canada:harp india:sitar brazil:berimbau) What is the output of the command echo ${#instruments[*]} [ ] 2 [ ] 4 [ ] 3 [ ] 1 [X] 5
414
41571. The command that will set an option so a search or substitute ignores case in vim ____________. [ ] :set noic [ ] :set hls is [X] :set ic [ ] :set hls
416
41772. What is the vim command to save changes with a filename you specify? [ ] :wq [ ] :q filename [X] :w filename [ ] :w!
418
41973. How may directories and sub-directories are created in the command mkdir -p {fall,winter,spring}/{lab{1,2},lecture{1,2},test{1,2}} [ ] 14 [ ] 7 [X] 21
420
4214/10/2018
42213/34
42374. ________________________is a program that manages a computer’s hardware. It also provides a basis for application programs and acts as an intermediary between the computer user and the computer hardware. [ ] Microsoft Office [ ] CPU [ ] Photoshop [X] Operating system
424
42575. ((a=20)) ((b=25)) if [ $a -gt $b ] && [ $b -gt 10 ] then echo $a $b else echo $b $a fi The script shown above will [ ] give an error [ ] display 20 25 [X] display 25 20
426
42776. What is the utility to check and repair a Linux filesystem? [ ] mount [ ] fdisk [X] fsck [ ] mkfs
428
42977. In order to ensure the proper execution of the operating system, we must be able to distinguish between the execution of operatingsystem code and userdefined code. So we need two separate modes of operation: [ ] timeshared mode and multiprogrammed mode [X] user mode and kernel mode [ ] virtual memory mode and physical memory mode [ ] singleuser mode and multiuser mode
430
43178. Based on the following declaration in bash groups=(audit:2001 finance:2002 account:2003 sales:2004 purchase:2005) What is the output of the command echo ${groups[*]} [X] audit:2001 finance:2002 account:2003 sales:2004 purchase:2005 [ ] There is no output from the command [ ] audit:2001
432
43379. ____________________________ systems provide an environment in which the various system resources (for example, CPU, memory, and peripheral devices) are utilized effectively, but they do not provide for user interaction with the computer system. [ ] Singleuser [ ] Time sharing [ ] Multiuser [X] Multiprogrammed
434
4354/10/2018
43614/34
43780. How may times will the echo statement execute ((a=3)) while [ $a -ge 3 ] || [ $a -le 5 ] do echo "Everest" ((a++)) done [X] infinite [ ] 0 [ ] 4 [ ] 3
438
43981. How will you verify that user2 has been deleted from the system? [ ] ls /home/user2 [ ] ls /root [ ] cat /etc/fstab | grep user2 [X] cat /etc/passwd | grep user2
440
44182. Logical drives can reside only on [ ] a swap partition [ ] a primary partition [X] an extended partition
442
44383. ls -l log.03052015 gives the following output: -rw-r--r-- 1 user2 faculty 0 Mar 5 19:59 log.03052015 What is the output of the following command echo "$(ls -l log.03052015 | cut -d" " -f4)" [X] faculty [ ] The command will give a syntax error [ ] Mar [ ] 0 [ ] user2
444
44584. The command used to delete the entire line in vim ________________. [ ] dw [ ] d^ [ ] d$ [X] dd
446
44785. What is the utility to attach "/media/user1/USB-Drive" to the root directory "/" [X] mount [ ] fsck [ ] mkfs [ ] fdisk
448
44986. Write the command to undo the last action [X] u [ ] U [ ] undo
450
4514/10/2018
45215/34
45387. What special variable will indicate the exit status of the last command? [X] $? [ ] $# [ ] $0 [ ] $9
454
45588. What is the output after the following statements are executed x=20;y=30 { x=300;y=400; } (x=30;y=40) echo $x $y [ ] 30 40 [ ] 20 30 [X] 300 400
456
45789. Which of the following command will search for binary, source code and manual page for cp command? [X] whereis cp [ ] locate cp [ ] man cp [ ] which cp
458
45990. What is root user's home directory? [X] /root [ ] /home [ ] /usr [ ] /home/user
460
46191. To undo all the changes on a line in vim, type: ___________. [ ] u [ ] R [X] U
462
46392. What is the command used to quit vim without saving the changes? [ ] :q [X] :q! [ ] :w [ ] :wq
464
46593. Login as the default user, what is the command used to reset root password? [ ] su [ ] pwd [X] sudo passwd root [ ] password
466
4674/10/2018
46816/34
46994. Write the command to undo all changes on a line [ ] undo [ ] u [X] U
470
47195. How many regular files are left in ~/budget/shared/plan after executing the commands?
472[ ] 1 [X] 0 [ ] 3 [ ] 4 [ ] 2
473
47496. The command that will display the size of the command history list in bash shell? [X] echo $HISTSIZE [ ] history size [ ] echo $PATH [ ] echo $HISTFILE
475
47697. Write the command to delete the contents from the cursors position until the beginning of the line. [X] d^ [ ] d$ [ ] dd
477
47898. Which symbol is used to indicate the beginning of a comment in a shell script. [X] # [ ] > [ ] ! [ ] < [ ] $
479
48099. Write the command to save changes and quit. [ ] :exit [ ] :quit [ ] :q! [X] :wq
481
4824/10/2018
48317/34
484100. The command that is used to yank (copy) the highlighted text in Visual mode in vim __________________. [ ] paste [X] y [ ] p [ ] copy
485
486101. What will the command echo $SHELL do? [X] it will show the default shell as specified in the environment variable SHELL [ ] it will show all shells currently in the system [ ] it will run the default shell
487
488102. The command echo $SHELL will [ ] print the string SHELL [ ] print the string $SHELL [ ] will give a syntax error [X] will show the shell in which the current user is logged in
489
490103. How many directories and sub directories have been created?
491[ ] 2 [X] 3 [ ] 4 [ ] 5
492
493104. The command used to move a process to foreground __________________. [X] fg [ ] ps [ ] nice [ ] bg
494
495105. Identify the command that is used to delete a group in Linux. [ ] gpasswd [ ] newgrp [X] groupdel [ ] groupmod
496
4974/10/2018
49818/34
499106. Identify the redirecton operator, that will not overwrite or create a new file. [ ] | [X] >> [ ] >
500
501107. The root account has access to all resources on a computer [X] True [ ] False
502
503108. The user has set the umask to 022. A file is created, what will be the file permission. [ ] ----r--r-[ ] ----rw-rw [ ] -rwxr-xr-x [X] -rw-r--r-[ ] -rw-rw-rw
504
505109. What does the command cat file1 file2 do? [X] concatenates files file1 and file2 and prints to standard output, (i.e. default - screen) [ ] redirects output of file1 to file2 [ ] takes each line from file1 and appends it to corresponding line in file2
506
507110. Identify the software that interacts with and processes requests from items such as keyboard, mouse, camera, microphone. [ ] Kernel [ ] flash memory [X] device driver [ ] BIOS [ ] application program
508
509111. In the above script, how many times will the Count $a statement print?
510[ ] 4 [ ] 3 [ ] 2 [ ] infinite [X] 5
511
5124/10/2018
51319/34
514112. How many maximum primary partitions are allowed in a drive? [ ] 1 [ ] 0 [ ] 3 [X] 4 [ ] 2
515
516113. The command "useradd -G account,audit user2" will [ ] add a user called user2 to the group root [ ] give an error [ ] add a user called user2 to the first group on the list [X] add user2 to groups account and audit
517
518114. Who are the members of finance?
519[ ] gavop, turoz [ ] gavop, woqag [ ] nibeg, turoz [X] turoz, woqag
520
521115. The command that will list all files in long format in current working directory including hidden files __________. [ ] ls -l [X] ls -la [ ] dir [ ] ls -a
522
523116. What is the Linux command that is used to update file's timestamp? [ ] clear [ ] cat [ ] more [X] touch
524
525117. What command reads the output of ls command and puts it below the cursor in VIM? [X] :r !ls [ ] :r filename ls [ ] :!ls filename
526
5274/10/2018
52820/34
529118. To run an external program in vim you should be in command mode. Write the command you will use to run the program [ ] :#! (command) [ ] :run (command) [X] :! (command) [ ] :# (command)
530
531119. Identify the root users home directory in Linux. [ ] /root/home [ ] / [ ] /home/root [X] /root
532
533120. The command that will change the primary prompt to the following: user@localhost:~$ [ ] PS2="\u@\h:\w$" [ ] echo "user@localhost:~$" [ ] echo $PS [X] PS1="\u@\h:\w$"
534
535121. Which command will give the name of the operating system that is currently running. [ ] whoami [ ] passwd [ ] su [ ] hostname [X] uname
536
537122. Identify the VIM command used to display your location in the file and the file status. [ ] GG [X] CTRL+G [ ] gg
538
539123. Answer the following three questions based on the following declaration in bash instruments= (russia:balalaika china:guqin canada:harp india:sitar brazil:berimbau) What is the output of the command echo ${instruments[*]} [X] russia:balalaika china:giqin canada:harp india:sitar brazil:berimbau [ ] instruments=(russia:balalaika china:guqin canada:harp india:sitar brazil:berimbau) [ ] 4 [ ] 5
540
541124. What environment variable is used to store the file name used to store command history in bash shell? [ ] $PATH [ ] $HISTSIZE [X] $HISTFILE [ ] $FILE
5424/10/2018
54321/34
544
545125. How many regular files are left in ~/budget after executing the commands?
546[ ] 1 [ ] 0 [X] 3 [ ] 2
547
548126. What is the output of the command "groups woqag"?
549[ ] woqag: account audit [ ] woqag: account finance [ ] woqag: account [X] woqag: account finance audit [ ] woqag: finance audit
550
551127. Which of the following Linux commands prevents you from accidentally overwriting a file when you redirect output to a file? [ ] umask [X] set -C [ ] echo $PATH [ ] set +o noclobber
552
553128. Modern operating systems are ______________ driven. If there are no processes to execute, no I/O devices to service, and no users to whom to respond, an operating system will sit quietly, waiting for something to happen. [ ] memory [ ] trap [X] interrupt [ ] hard disk
554
5554/10/2018
55622/34
557129. Answer the following question based on the output of /dev/sdb How many logical drives are created?
558[X] 2 [ ] 4 [ ] 1 [ ] 3
559
560130. Which one of the two pathnames will work regardless of the current directory the user is in [ ] relative path [X] absolute path
561
562131. Regular users in Linux can only lower the priorities of the processes they own. [X] True [ ] False
563
564132. Which of the following commands will create a hard link called table to /home/policy/table in users's home directory? [ ] ln -s /home/policy/table ~/table [X] ln /home/policy/table ~/table [ ] cat /etc/fstab [ ] ln /etc/fstab ~/fstab [ ] touch /etc/fstab
565
566133. How may additional primary partitions can be created? [ ] 1 [X] 2 [ ] 4 [ ] None [ ] 5
567
568134. What is the utility to build a Linux filesystem? [ ] fdisk [ ] fsck [ ] mount [X] mkfs
569
570135. How will you insert text before the cursor [ ] o [ ] a [X] i [ ] e
571
5724/10/2018
57323/34
574136. In bash shell, what is the operation done by a dollar sign and brackets $( )? [ ] logical evaluation [ ] arithmetic expansion [ ] parameter expansion [X] command substitution [ ] arithmetic evaluation
575
576137. Which command will remove all files that begin with a, b or c in the current directory? [ ] rm [a][b][c]? [ ] rm [a][b][c]* [ ] rm [abc]? [X] rm [abc]*
577
578138. ___________ can be used to prevent a user program from getting stuck in an infinite loop or to fail to call system services and never return control to the operating system. [ ] Swapping [ ] Trap [X] Timer [ ] Virtual memory
579
580139. To run a shell script a user must have a minumum of [ ] execute permission [X] read and execute permission [ ] write and execute permission
581
582140. Which directory stores device files, i.e. files that interface with hardware and filesystem [X] /dev [ ] /root [ ] /bin [ ] /var [ ] /etc
583
584141. Write the command to search for a string of characters in the forward direction, i.e. from the cursors position until the end of the file. [ ] ? (search) [ ] ! (search) [ ] \ (search) [X] / (search)
585
5864/10/2018
58724/34
588142. What minimum permission, is required for a directory, to delete a file? [ ] read, write and execute [ ] read [ ] read and execute [ ] read and write [X] write and execute
589
590143. What does the command touch file1 do? [X] creates file1 with zero bytes if it does not exist, if file1 exists touch will update the time stamp of the file. [ ] creates file1 with zero bytes, if file1 exists touch overwrites and creates a file with zero bytes. [ ] creates file1 with zero bytes, gives an error if file1 exists.
591
592144. Who are members of group wind?
593[X] player2, player3, player4 [ ] player1, player3, player4 [ ] player1, player2 [ ] player2, player4
594
595145. Which command will restart the system immediately [ ] shutdown -c [ ] shutdown -k [X] shutdown -r now [ ] shutdown -P now [ ] shutdown -h now
596
597146. To replace the character under the cursor in vim, type _____ and then the character you want to have there. [X] r [ ] c [ ] b [ ] d
598
599147. Which of the following is NOT true about soft link in Linux? [X] All soft links are functional even if the original file is removed [ ] You may create multiple soft links to the same file [ ] All soft links have a different inode number as the original file
600
6014/10/2018
60225/34
603148. As processes enter the system, they are put into a __________, which consists of all processes in the system. [ ] device queue [X] job queue [ ] ready queue [ ] priority queue
604
605149. The vim command used to delete from the cursor to the end of a line: _____________________. [ ] dd [ ] dw [X] d$ [ ] 2d
606
607150. The command that will display all files(including hidden files) in user's home directory ___________________. [ ] cd ~ [ ] ls -l ~/ [X] ls -a ~/ [ ] ls ~/
608
609151. Which of the following are all valid basic file permissions in Linux? [ ] Read, Write, hidden, Read Only, Execute [ ] Read, Hidden, Execute [ ] Read, System, Hidden, Archive [X] Read, Write, Execute
610
611152. What umask should be set so the resultant file permission is -rw-r-xr-x [ ] 033 [ ] 022 [ ] 122 [ ] 044 [X] 011
612
613153. What is the utility to add and delete disk partitions? [ ] mount [ ] mkfs [ ] fsck [X] fdisk
614
615154. What is the output of the command echo ‘We pay $32 per month for Internet’ [X] We pay $32 per month for Internet [ ] ‘We pay $32 per month for Internet’ [ ] We pay 32 per month for Internet
616
6174/10/2018
61826/34
619155. Information about a file, a directory, the directory’s parent and each of its children is stored in a data structure called [ ] timestamp [X] inode [ ] hardlink [ ] metadata [ ] linkcount
620
621156. System programs will run in [X] kernal mode [ ] user mode
622
623157. Identify the extended partition
624[ ] /dev/sdb6 [ ] /dev/sdb1 [X] /dev/sdb2 [ ] /dev/sdb5
625
626158. User PrjMgr copies the file Plan.Q01 to directory \archive\Mgt\Q01 using the following command: cp \home\PrjMgr\Plan.Q01 \archive\Mgt\Q01\ What are the minimum permissions required for the directories PrjMgr and Mgt [X] for source directory x, for target directory w and x [ ] for source directory r, w and x, for target directory r and w [ ] for source directory w, for target directory w and x [ ] for source directory r and w, for target directory r and w [ ] for source directory x, for target directory r and x
627
628159. What is the command used to re-execute the second command in the command history list in bash shell? [X] !2 [ ] history -c [ ] !! [ ] history -2
629
630160. ln -s oldfilename slinkname creates a [ ] lists the directory structure in short form [ ] removes the link from oldfile and places it in slinkname [X] symbolic link (soft link) to a file [ ] hard link to a file
631
6324/10/2018
63327/34
634161. A computer system runs several processes in the same time frame. More than one process is running towards its completion. Such a system is called [ ] context switching [ ] swapping [X] multitasking
635
636162. What special variable will indicate the number of positional parameters? [ ] $0 [ ] $0 [ ] $? [X] $#
637
638163. A process that can affect or be affected by the other processes executing in the system is called a ___________ process. [ ] independent [X] cooperating [ ] child [ ] parent
639
640164. To clear command history, you should use command _________________. [ ] clear [ ] !! [ ] history | more [X] history -c
641
642165. Identify the extended partition
643[ ] /dev/sdc1 [ ] /dev/sdc2 [ ] /dev/sdc5 [X] /dev/sdc3 [ ] /dev/sdc6
644
645166. A task is currently running using the CPU. It is interrupted by the kernel with the intention of resuming later. What term fits this description, [ ] multi user operating system [ ] multi processor system [X] pre-emption [ ] single user operating system
646
6474/10/2018
64828/34
649167. The cp command will fail because it has more than two arguments [X] False [ ] True
650
651168. The ________________, or CPU scheduler, selects from among the processes that are ready to execute and allocates the CPU to one of them. [ ] ready queue [X] short-term scheduler [ ] long-term scheduler [ ] device queue
652
653169. Identify the command that will allow the superuser to delete account and home directory of user2 [X] userdel -r user2 [ ] usermod -d user2 [ ] usermod -r user2 [ ] userdel user2
654
655170. Which of the following commands will substitute 'new' for all 'old's on a line in VIM? [ ] :%s/old/new/g [X] :s/old/new/g [ ] :s/old/new
656
657171. Write the command to search for a string of characters in the reverse direction, i.e. from the cursors position until the beginning of the file. [ ] / (search) [ ] \ (search) [ ] ! (search) [X] ? (search)
658
659172. Which of the following is not true about cp command in Linux? [ ] The default cp command does not copy directories [ ] The default cp command will overwrite existing file without prompting user. [ ] The cp command can copy multiple files from one location to another. [X] The cp command does not copy directories
660
661173. What is the command that displays all kill signals in Linux? [ ] killall [X] kill -l [ ] kill
662
6634/10/2018
66429/34
665174. What are the two fundamental models of inter-process communication? [ ] parent and child [ ] virtual and phyiscal [ ] cooperating and independent [X] shared memory and message passing
666
667175. To show a list of commands that start with "w" in vim, you should ___________________________ [X] type :w, and press (CTRL-D) [ ] type :help w [ ] type :w, and press (F1) [ ] type :w, and press (TAB)
668
669176. Which of the following commands that renames ~/lab3rv/suse to ~/lab3rv/suse.save? [ ] cp ~/lab3rv/suse ~/lab3rv/suse.save [ ] mkdir ~/lab3rv/suse ~/lab3rv/suse.save [ ] rm ~/lab3rv/suse ~/lab3rv/suse.save [X] mv ~/lab3rv/suse ~/lab3rv/suse.save
670
671177. ____________________ abstracts main memory into a large, uniform array of storage, separating logical memory as viewed by the user from physical memory, which enables users to run programs that are larger than actual physical memory. [ ] Cache [ ] Main memory [ ] Hard disk [X] Virtual memory
672
673178. The command that will shutdown the Linux system in 20 minutes ______________________. [ ] sudo reboot [X] sudo shutdown -h +20 [ ] sudo shutdown -r +20 [ ] exit
674
675179. Answer the following question based on the output of /dev/sdc How many logical drives are created?
676[ ] 4 [X] 2 [ ] 3 [ ] 1
677
6784/10/2018
67930/34
680180. Identify the term that matches this description. Programs usually started at boot-up time, provides service(s) to other programs that are run by a user or by the system. [X] daemon [ ] background process [ ] foreground process [ ] kernel
681
682181. Which directory stores libraries and executables needed to run programs that usually reside in /bin and /sbin [X] /lib [ ] /var [ ] /bin [ ] /etc [ ] /dev
683
684182. What is the command used in bash shell to display the command history list? [ ] locate [ ] type [ ] list [X] history
685
686183. What is the permission, in octal mode, of the file MySQL.log, given the file listing: -rwxrw--w- 2 maotse students 15 Jan 25 12:37 MySQL.log [ ] 732 [ ] 651 [X] 762 [ ] 652
687
688184. To insert before the cursor in vim, you type __________ [ ] A [X] i [ ] o [ ] a
689
690185. What is the command used to undo the last action in vim? [ ] r [X] u [ ] U [ ] A
691
6924/10/2018
69331/34
694186. In VIM, to insert the content of a file, you type ___________________ [ ] :e filename [ ] :rm filename [ ] :!filename [X] :r filename
695
696187. Identify the file that stores encrypted passwords [ ] /etc/fstab [ ] /etc/group [X] /etc/shadow [ ] /etc/gshadow [ ] /etc/passwd
697
698188. How many times will the echo statement execute when the following script is run? for num in {1..10..2} do echo $num done [X] 5 [ ] 0 [ ] 3 [ ] 4 [ ] 2
699
700189. Write the command you will use to copy 4 line in the buffer [ ] 4cp [X] 4yy [ ] yy4 [ ] cop4
701
702190. A script is running in user space on a Linux installation. What would you call it? [ ] program [ ] virtual memory [ ] physical memory [X] process
703
704191. The Linux command that allows for deleting a directory, but only if it is empty: [ ] mv -u [ ] rm [ ] del [X] rmdir
705
706192. Type ___________ to insert text AFTER the cursor and place you in Insert mode in vim. [ ] o [X] a [ ] e [ ] i
7074/10/2018
70832/34
709
710193. Based on the following declaration in bash groups=(audit:2001 finance:2002 account:2003 sales:2004 purchase:2005) What is the output of the command echo ${#groups[*]} [X] 5 [ ] * [ ] 0 [ ] 4
711
712194. Who are members of group player2?
713[X] player2,player4 [ ] player1,player2 [ ] player2,player3 [ ] player2
714
715195. Answer the following three questions based on the following declaration in bash instruments= (russia:balalaika china:guqin canada:harp india:sitar brazil:berimbau) What is the output of the command echo $instruments[*] | cut -d" " -f5 [X] brazil:berimbau [ ] china:guqin [ ] canada:harp [ ] india:sitar [ ] russia:balalaika
716
717196. user1 moves the file budget.2015 using the following command. mv /home/user1/budget.2015 /home/accounts/ The minimum permission required for source and target directories are [ ] read permission for /home/user1 directory and write permission for /home/accounts directory [X] write and execute permission for both /home/user1 and /home/accounts directory [ ] read and write permission for /home/user1 directory and /home/accounts directory [ ] read permission for /home/user1 directory and /home/accounts directory [ ] write permission for /home/user1 directory and /home/accounts directory
718
719197. Identify the command that displays an entire list of processes status across all terminals ____________. [X] ps -ef [ ] ps -f [ ] ps
720
7214/10/2018
72233/34
723198. Switching the CPU to another process requires performing a state save of the current process and a state restore of a different process. This task is known as a _________________. [X] context switch [ ] memory allocation [ ] process scheduling [ ] long-term scheduler
724
725199. Is there space available to create another partition?
726[ ] Cannot determine with the given data [X] Yes [ ] No
727
728200. Which of the following uses the bash shell as the command interpreter in a script? [X] #!/bin/bash [ ] #/binbash [ ] /bin/bash [ ] !/bin/bash
729
730201. How many additional primary partitions can be created?
731[ ] 5 [ ] 0 [X] 1 [ ] 4 [ ] 2
732
733202. A script contains a set of instructions, it is a passive entity stored on non-volatile media, such as a hard disk or flash. What would you call such a file. [ ] virtual memory [ ] process [ ] physical memory [X] program
734
735203. Write the command to delete the entire line at the cursor [ ] d^ [X] dd [ ] d$
736
7374/10/2018
73834/34
739204. Which operator is used when you want the second command to execute only when the preceding command succeeds? [ ] ; [ ] >> [X] && [ ] ||
740
741205. Write the command to delete the contents from the cursors position until the end of the line [X] d$ [ ] dd [ ] d^
742
743206. A user edits a document using vim. Identify the memory area where it runs. [X] user space [ ] kernel space [ ] device driver routines
744
745207. In bash shell, what is the operation done by braces { }? [ ] arithmetic evaluation [ ] command substitution [ ] arithmetic expansion [ ] logical evauluation [X] parameter expansion
746
747s/old/new/g
748:r filename to insert
749ctrl +Z send process to a background
750
751
75240) A ____________ is a passive entity, such as a file containing a list of instructions stored on disk (often called an executable file). In contrast, a ___________ is an active entity, with a program counter specifying the next instruction to execute and a set
753of associated resources. A program becomes a process when an executable file is loaded into memory. A. program, process
75441) The ________________, or CPU scheduler, selects from among the processes that are ready to execute and allocates the CPU to one of them. A. short-term scheduler
75542) In VIM, to insert the content of a file, you type ___________________ B. :r filename
75643) Typing __________ followed by a phrase searches BACKWARD for the phrase in VIM. A. ?
75744) The command that will set an option so a search or substitute ignores case in vim __________________. D. :ignore case
75845) Process priority could be changed by using ____________ command. A. fg B. bg C. ps D. nice E. None of the above
759
760
761// chmod +x one.sh
762hiba@hiba-virtual-machine:~/Desktop$ ./one.sh