· 8 years ago · Apr 16, 2018, 05:38 PM
1
2Chapter 1 Lab:
3VIm editor to create a script file to change and export the SHELL enviornment.
4step 1. vi /etc/pref_shell
5step 2. a
6step 3. SHELL=/bin/csh
7export SHELL
8step 4: press esc
9step 5: press :
10step 6: type wq
11
12lab 2: you have just added a custom script to change and export the shell
13step 1: vi /etc/pref_shell
14stpe 2: a
15step 3: SHELL=/bin/tcsh
16step 4: esc
17step 5: :wq
18
19
20Lab: White Horse
21step 1: mkdir wh
22step 2: mkdir wh/plan
23step 3: mkdir wh/research
24step 4: mkdir wh/implement
25
26Lab delete directories:
27rmdir /projects/heartbt
28rmdir /projects/heartmon
29rmdir /projects/hearstrng
30
31Lab: View contents of /root/.bash_profile
32use cat
33
34You have an executable file named ni that allows you to save a snapshot of your network information with the date and time into a log file. The file is in the /root directory, and /root is the current working directory. How would you run the executable file? (Select two.)
35./ni
36/root/ni
37Which of the following options is the standard shell for most Linux computers?
38Bourneagain shell (bash)
39What would you enter at the command prompt to start a new Bourne-again shell (bash) session?
40(typed)
41bash
42What command should you enter to see a list of all the commands you recently used at the command prompt?
43history
44You have the rnyapp executable file. It is found in the current directory, but not in the command path. What would you enter at the command prompt to start the rnyapp file and replace the shell with myapp process?
45(typed)
46exec ./myapp
47What is the result of the uname -a command?
48All system information is displayed on the screen.
49What would you enter at the command prompt to display the present working directory?
50(typed)
51pwd
52Which of the following commands could you use to search man pages for a specific keyword? (Select three.)
53aproposwhatisman -k
54You are working on a Linux system and need more information about the uname command. What would you enter at the command prompt to learn about the uname command syntax and options?
55(typed)
56man uname
57What command can be used on most Linux distributions to find the directories where the man pages are kept?
58(typed)
59echo $MANPATH
60Following is a list of the first four sections typically found in a man page. Which of these shows a list of options available for a Linux command and explain what the options do?
61DESCRIPTION
62If you are viewing the contents of a man page, which key can you press to get back to the beginning of the page?
63
64(typed)
65home
66Which key combination should you press in vi to save the file you are working on and quit?
67:wq
68You need to create a new text file with the name network, txtin the current directory. Which command starts vi and creates the file?
69vi network.txt
70You have opened the /root/myscript file in vi. While looking at the file, your soda spilled, and you hit several keys on the keyboard trying to pick it back up. There are extra characters everywhere in the file, and you know you can't fix it. How do you exit vi without saving the changes?
71:q!
72A friend sent you a shell script file that is 117 lines long. He says that he wants you to examine code on lines 82 through 87. What command would you enter while in vi command mode to go directly to line 82?
73(typed)
74#82
75After opening a file in vi, you want to switch from command mode to command line mode. What key should you enter?
76(typed)
77:
78You made a few changes to the /boot/grub/grub.conf file and now you need to exit out of insert mode, save the changes, and quit. What should you do? (Select two. Each answer is a required part of the solution.)
79Press EscType :wq
80What are two methods to exit vi from command mode? (Select two. Each answer is an independent solution.)
81Type :wqType ZZ
82Match the vim mode on the left to the correct definition on the right.
83
841) The initial vim mode used when vim is started. It has commands that cut and replace text, and it is the mode vi uses to enter the other modes
85
862) The mode that works with the file system. Use it to save files after editing them.
87
883) The mode that vim uses to write and edit text in the file.
891) Command mode
902) Command line mode
913) Edit mode
92What command would you enter while in vi command mode to find the term Sami
93(typed)
94/Sam
95While in command mode, you copied a whole line of text to memory. You navigated to a different location in the file, and now you need to place the line of text. What command should you use?
96p
97What command would you enter while in vi command mode to copy an entire line of text?
98
99(typed)
100yy
101Which of the following commands will cut an entire line from a file while in vi command mode?
102dd
103You are editing a text file with vi and need to open a new line above the one you are currently working on. What key should you press to accomplish this?
104O
105Match the command on the left with the description on the right to navigate while in vi command mode.
106
1071) Move the cursor up a line.
1082) Move the cursor one space to the left,
1093) Move the cursor one space to the right.
1104) Move the cursor down a line.
1111) k
1122) h
1133) l (lower L)
1144) j
115Which of the following commands will create a shortcut to the tail -f /var/log/messages command?
116alias sysmesg="tail -f /var/log/messages"
117Which command will display a list of the currently defined aliases on the system?
118(typed)
119alias
120What commonly predefined alias is configured to run the Is -I command?
121
122(typed)
123ll
124You must do which of the following to define a persistent alias?
125Add the command defining the alias to the appropriate shell configuration file.
126The user mbrown has a directory named logs in her home directory that is regularly updated with new log files when certain system events occur. She runs the following commands several times a week to check this directory:
127• cd /home/mbrown/logs
128• Is -al
129She wants a persistent alias named logcheckto be created to run these two commands. What command would you enter into her shell configuration file to create this persistent alias?
130
131(typed)
132Alias logcheck="cd /home/mbrown/logs;ls -al"
133
134(NO SPACE between ";")
135You need to set the COMP variable to the value 1745. Which command will set the variable so it is available to other shell programs?
136export COMP=1745
137Two users should have identical settings, yet one is having problems with the display on his screen and you suspect there is a difference in their environment variables. Which command will display all the environment variables?
138env
139Which of the following statements best describes the PATH environment variable?
140It contains the directory prefixes used to search for programs and files.
141You want the directory /sbin/special to always be a part of the PATH. You also want to keep all the current entries in your PATH statement. Which of the following commands would you use?
142PATH=$PATH:/sbin/special
143What line must you add to /etc/profile to make sure /sbin/custom is always part of the PATH environment variable for all users, without overwriting the current entries in the PATH statement?
144
145(typed)
146PATH=$PATH:/sbin/custom; export PATH
147Which command shows the value of the LANG environmental variable currently set for the language the operating system uses?
148echo $LANG
149You want to view the number of commands your HISTSIZE environment variable is set to save. You don't want to have to scroll through all the environment variables. Which command shows you the value for the HISTSIZE variable?
150echo $HISTSIZE
151Which of the following presents the greatest security risk?
152The PATH statement includes . (period).
153Which command will display all the environment variables on the system?
154
155(typed)
156set
157
158I think it is = env?
159Which command will display only the environment variables applied to child sessions?
160
161(typed)
162env
163You recently used the HOST=FS4 command. What command should you use to make the environment variable to apply to all child sessions?
164export HOST
165Which environment variable affects the number of past commands used in the current shell session?
166
167(typed)
168HISTSIZE
169Which of the following commands will configure the shell to retain 300 recently-used commands in the ~/.bash_history file for multiple shell sessions?
170HISTFILESIZE=300
171All users at your site are using the Bash shell. You want to set a variable that will apply to every user and always have the same value. Which file would you place this variable in?
172/etc/profile
173A user is requesting that each time she logs in, a particular entry be written to a log file. This will only apply to her and she is using the Bash shell. In which configuration file would you make an entry for this action to take place?
174.profile
175Which of the following files would you use to create aliases that are applied when a specific user starts a BASH session? (Select two.)
176~/.bashrc~/.profile
177After a user starts a BASH session and the scripts in /etc/profile are applied, what is the next file that could affect the shell session?
178~/.bash_profile
179Your default target on your Linux system is set to multi-user mode; however, you want the X Windows System to launch when you log into the system. Which file should you edit?
180~/.bash_login
181You are trying to debug a shell script called myscript and to aid you in this task you would like to have the output of the script be recorded in a text file.Which of the following commands would satisfy your requirements?
182myscript >>testfile.txt
183What will be the effect of the following command? Is -I /usr/bin >> /tmp/list.txt
184The contents of the /usr/bin directory will be redirected into a file called /tmp/list.txt, inserted after previous contents of the file.
185You are trying to debug a shell script that has the command Is -s in it. You suspect an error is occurring here and want to send the results of the operation (successful or error) to a file named Friday in order to examine it later.Which of the following commands should you use?
186Is -s> Friday 2>&1
187Which of the following commands will give the same results as cat < turbo?
188Cat turbo
189Which of the following commands sorts the contents of wordlistl and wordlist2 and sends the result to standard output?
190cat/usr/wordlistl /usr/wordlist2 | sort
191Which symbol uses the output of one command as the input of another command?
192
193(typed)
194|
195Which command reads from standard input and writes to standard output and files?
196
197(typed)
198tee
199Which of the following commands displays the contents of wordlistl and wordlist2 then sorts the combined contents, then sends the results to the monitor and a file named sortedwordlisf?
200cat/usr/wordlistl /usr/wordlist2 | sort | tee sortedwordlist
201Which command overcomes the 128 KB shell command size restriction by breaking up long lists of arguments?
202
203(typed)
204xargs
205Which of the following commands redirects standard output to standard error?
206cat txtfile 1>&2
207You need to create the directory /var/oracle/database/9i. Only the directory /var currently exists. From the root of the filesystem, which command will create the directory path?
208mkdir -p /var/oracle/database/9i
209In the /var directory is a subdirectory called backup. You need to delete the directory backup and any files. You change directory focus to /var. Which command will delete the directory backup and its files?
210rm -rf backup
211You need to make an expanded listing of all the files in /etc. Which command will produce the listing?
212ls -al /etc
213You need to view the contents of the /home/jerrys directory. What would you enter at the command prompt to show all the contents, including hidden files and directories?
214
215(typed)
216ls -a /home/jerrys
217Which of the following command copies the entire /temp directory with all of its files, sub-directories, and files in the sub-directories to the /home/gshant directory. (Select two. Each answer represents an independent solution.)
218cp -r /temp /home/gshantcp -R /temp /home/gshant
219The /home/gshant/smp directory is empty and needs to be removed. You change directories to /home/gshant. What would you enter at the command prompt to remove the smp directory?
220
221(typed)
222rmdir smp
223The /home/gshant/smp directory contains several files. The directory and files need to be removed. You change directories to /home/gshant. What would you enter at the command prompt to remove the smp directory and the files it contains?
224
225(typed)
226rm -r smp
227Which of the following commands combines three files into a single text stream?
228cat
229You are logged in as root. You have the file, letter.doc, on a CD in the first compact disk drive. Which command will copy the file from the CD to your home directory.
230cp /mnt/scdO/letter.doc /root
231Which command would you use to rename the /home/pmallory/reports file to reports.bak?
232mv /home/pmallory/reports /home/pmallory/i'eports.bak
233Which command would you use to move a file from one location to another?
234mv
235Which command prints the attributes of a /boot/grub/grub.conf file?
236Isattr /boot/grub/grub.conf
237Which of the following commands will change the /home/gshants/smile file's modification and last accessed times to the current time?
238touch /home/gshants/smile
239What would you enter at the command prompt to display a file's type?
240
241(typed)
242file
243You want to view the contents of a directory, but the output of the Is -I command scrolls beyond the limit of one console window.
244Which of the following commands would allow you to see the full listing of the directory?
245Is -I | less
246Which of the following would be the result of the command In -b /v/filel /data/filel?
247A copy of the file ~/filel would be placed in /data.
248You previously created symbolic links in your home directory to a set of files in the /data directory using the In -s command. The system administrator has just deleted those files. What happens to the links that you created?
249The symbolic links would still exist in your home directory but they would now be broken.
250Drag the permission string on the left to the category on the right. (Tip: Some permission strings will not be used.)
251
2521) Soft link
2532) Hard link
2541) Irwxrwxrwx
255
2562) -rwxr-xr-x
257Which of the following is not a characteristic of symbolic links?
258Valid inode for the file data even if the original file is deleted.
259Which of the following is not a characteristic of hard links?
260Distinct inode
261After using the Is command in the current working directory, you notice the following files:
262Irwxrwxrwx 1 root root 4 2010-11-05 myfile ->
263
264shantsgems -rwxr-xr-x 1 root root 382 2010-10-05 shantsgems
265What is true about the files?
266myfile is a symbolic link to shantsgems.
267What is the full path to the directory that contains data files that change constantly, including email, print jobs, and proxy cache files?
268(typed)
269/var
270Which path represents the root directory?
271/
272Under the Filesystem Hierarchy Standard (FHS), what is the full path to the directory that contains the device files for a Linux system?
273
274(typed)
275/dev
276Under the Filesystem Hierarchy Standard (FHS), which directory contains information about the system state and processes?
277/proc
278Which directory is the home directory for the root user account?
279/root
280Which two statements best describe the purpose of the Filesystem Hierarchy Standard (FHS)?
281During installation, software can predict where to place configuration files.
282Individual users can predict where to find system configuration files.
283What is the full path to the directory that holds the man files on the system?
284
285(typed)
286/usr/share/man
287Which of the following commands finds files with the .txt extension in the /home/gshant directory?
288find /home/gshant -name
289You need to find all files in the /home/gshant directory that are larger than 300K. You change directories to /home/gshant. What would you enter at the command prompt to find these files?
290
291(typed)
292find -size +300k
293Which statement describes file globbing?
294Using wildcards to match specific files.
295You need to quickly see all of the lines in the blue_and_gold text file that do not reference Karen. Which command would you use to accomplish this?
296grep -v Karen blue_and_gold
297-v = not matching
298Which command would you use in a script to parse out entries that contain the word those from a file named config in a folder named diet beneath the /etc directory?
299grep those /etc/diet/config
300You want to perform an audit and make sure that group membership for user dblair is correct. Which command would you use to view the groups that dblair is a member of?
301grep -e dblair /etc/group
302Which of the following files will be displayed when using the egrep exhibit[0-9]+ ~/samps command? (Select two.)
303exhibit125
304exhibit1
305Which of the following commands is the fastest method to search a file for fixed strings, rather than regular expressions?
306fgrep
307You are looking for a specific five-character string in the ~/customquote file with the grep command. The string should begin with the letter g, end with an y, and be the last string on the line.
308Which regular expression should you use with grep?
309"g...y$"
310Which of the following commands would you use to find all of the files on the system that have either blue or gold in their names?
311find / -name 'blue' -o -name 'gold"
312You use a program on your Linux system named photorec. What would you enter at the command prompt to display the path to the photorec binary file?
313
314(typed)
315which photorec
316You need to configure a few changes to how the locatedb index file is created. What is the full path and filename of the file you should edit?
317
318(typed)
319/ect/updatedb.conf
320Which of the following files would not be found by the locate -i LibraryFines.csv command?
321libraryfines.csv1
322-i = disables case sensitivity.
323Which single command should you use to find the path and manual pages for the mycustomapp program?
324whereis mycustomapp
325After using the locate command, you discover some of your files are not being listed in the search results. What would you enter at the command prompt to update the /var/log/locatedb file?
326
327(typed)
328updatedb
329
330An employee named Bob Fulin, with a user name of bfulin, has left the company. You have been instructed by your supervisor to delete his user account along with his home directory. Which of the following commands would produce the required outcome? (choose all that apply)(2)
3311) userdel -h bfulin
3322) userdel bfulin
3333) userdel -r bfulin
3344) userdel bfulin;rm -rf /home/bfulin
3353) userdel -r bfulin4) userdel bfulin;rm -rf /home/bfulin
336What would be the outcome of the following command?
337userdel -r jjones
3381) The user account, jjones, would be deleted along with jjones' home directory.
3392) The user jjones' home directory would be deleted, but the user account would still exist.
3403) The user account, jjones, would be deleted, but jjones' home directory would be left untouched.
3414) The user account, jjones, would be deleted along with jjones' home directory and all files owned by jjones.
3421) The user account, jjones, would be deleted along with jjones' home directory.
343Which useradd option displays the default values specified in the /etc/default/useradd file.
344-D
345A programmer named Brandon calls with an issue. He is currently using the C shell each time he logs in, but has been told by his manager to start using the Bash shell. Which command will change brandon's shell to the desired setting?
3461) usermod -s /bin/bash brandon
3472) usermod brandon /bin/bash
3483) useradd brandon /bin/bash
3494) userchange -a brandon /bin/bash
3501) usermod -s /bin/bash brandon
351You suspect that the gshant user account is locked, Which command will show the status of the user account? (enter the command as if at the command prompt)
352passwd -S gshant
353Which directory contains a set of configuration file templates that are copied into a new user's home directory when it is created? (enter the full path to the directory)
354/etc/skel
355One of your users Karen Scott, has recently married and is now Karen Jones. She has requested that her username be changed from kscott to kjones, but no other values change. Which of the following commands will accomplish this?
3561) usermod -l kscott kjones
3572) usermod -u kscott kjones
3583) usermod -u kjones kscott
3594) usermod -l kjones kscott
3604) usermod -l kjones kscott
361Which of the following utilities would you typically use to lock a user account? (select two)
3621) passwd
3632) useradd
3643) usermod
3654) userdel
3661) passwd3) usermod
367You need to change the default home directory value used by the useradd utility when creating a user account. Which file should you edit? (Enter the full path to the file)
368etc/default/useradd
369Which file stores BASH preferences for the gshant user account? (enter the full path)
370/home/gshant/.bash_profile
371You are configuring a Linux system for 5 different users. Before you create the user accounts, you need to ensure that specific commands execute clean up tasks when the user logs out of the Linux system.
372You want to reduce redundant actions by configuring the commands once for all users that will be created on the system. Where should you configure the commands?
3731) /etc/skel/.bash_logout
3742) ~/.bash_logout
3753) ~/.bash_profile
3764) /etc/profile
3771) /etc/skel/.bash_logout
378You have performed an audit and have found active accounts for employees who no longer work for the company. You want to disable those accounts. What command example will disable a user account?
3791) usermod -u joer
3802) usermod -d joer
3813) usermod -l joer
3824) usermod -L joer
3834) usermod -L joer
384A user with an account name of larry has just been terminated from the company. There is good reason to believe that the user will attempt to access and damage the files in the system in the very near future. Which command below will disable or remove the user account from the system and remove his home directory?
3851) userdel -r larry
3862) userdel -home larry
3873) userdel larry
3884) userdel -h larry
3891) userdel -r larry
390You need to create a user account with these specific parameters:
391Use pmorrill as the login name.
392Use Paul Morrill as the comment.
393Use /home/pmorrill_temp as the home directory.
394Use 683 as the UID.
395Which command should you use?
3961) useradd pmorrill -c Paul Morrill -d /home/pmorrill_temp -u 683
3972) useradd -c Paul Morrill -d /home/pmorrill_temp -u 683 pmorrill
3983) useradd -d Paul Morrill -h /home/pmorrill_temp -u 683 pmorrill
3994) useradd -c Paul Morrill -d ~/pmorrill_temp -u 683 pmorrill
4002) useradd -c Paul Morrill -d /home/pmorrill_te
401
402
403
404
405
406
407Lab:
408View the currently set environment variables to find the values below
409step 1: use echo $
410
411Lab: You need to view detailed information for the hr directory
412step 1: use the ls-l /
413Lab : What is the name of the hidden directory in /hr?
414step 1: use ls -a / hr
415
416Chapter 6
417Lab #1: UID for the schawla
418View the /etc/password file to answer questions
419Step 1: cat /etc/password
420
421VP of Sales promoted Salman. Identify all groups to which the schawla user belong
422add mgmt 2 and hr
423step 1: groups schawla
424step 2: usermod -aG mgmt2, hr schawla
425step 3: cat /etc/group
426
427
428Lab #2:
429Task:
430Rename user acccount, change the comment field, change the home directory
431Step 1: usermod -c "brenda palmer" -d /home/bpalmer -m -l bpalmer bcassini
432Step 2: cat /etc/password
433Step 3: ls /home
434
435
4366.4
437Lab: Maggie Brown and cflynn, make mbrown a secondary member
438as a secondary group, make mbrown a member of the hrp group. make cflynn a member of the hr grtoup.
439step 1: usermod -G hr mbrown
440step 2: usermod -G hr cflynn
441
442
443lab
444To add group: groupadd
445To change the name : -n
446TO delete group: groupdel
447to display: groups
448usermod -G acct, admin lsmith
449to delete group after transfer: usermod -G "" emcmann
450
451Chapter 7
452
4537.1
454Lab #1:
455Which physical disk is the swap area on? 1st
456Which partition? 5th
457 what is the beginning cylinder fot he swap area? (look at sd5 start) 9668
458What is the allocated size of the swap area in blocks? 473632
459Which physical disk is the boot disk on? 1st
460Which disk parition is the booth disk on? 1st
461Command: fdisk -l
462
463Practice Questions
464!!Really skimmed but hopefully helps.
46511 QUESTIONS
4661. Type the full device file name for the second partition on the hard drive with the lowest ID:
467/dev/sda2
468Name for first partition on hard drive w/ third lowest ID number
469/dev/sdc1
470Local terminal on the sytem:
471/dev/tty2
472directory contains device files
473/dev
474to partition new drive:
475fdisk /dev/sdb
476
4777.2
478Practice Questions
479!!Really skimmed but hopefully helps.
4805 QUESTIONS
481What command do you use to start up the GUID disk management utility to create partitions on the /dev/sdb drive?
482gdisk /dev/sdb
483logical volumes?
484lvscan
485physical volumes?
486pvscan
487You need to create a logical volume named video in the home volume group and give it 2 TB of disk space. Which command would you use to complete this task?
488Ivcreate -L 2T -n video home
489You have added a third hard disk to your Linux system. What command would you use to initialize a physical volume on this disk for later use by the Logical Volume Manager?
490pvcreate /dev/sdc
4917.3
492Lab #1:
493Format the partition: format the /dev/sdb1 partition with the ext3 file system
494Command:
495mke2fs -j /dev/sdb1
496
497Lab #2:
498Format the partitions with the ext4 file system
499Command:
500
501mke2fs -t ext4 /dev/sdc1
502repeat, using /dev/sdc2
503
504Lab #3:
505Create a swap partition on /dev/sdb2, and activate
506command: mkswap, then swapon
507
5087.4
509Lab:
510command: mkswap /dev/sdb2
511swapon
5127.5
513Lab #1:
514Create a /mtn/disk directory, then mount it to the directory with the ext3 file system
515mkdir /mnt/disk
516mount -t ext3 /dev/sdb1 /mtn/disk
517mount to verify
518
519Lab #2: Unmount /dev/sdb2 from /root/newdrive, then mount it to mnt/drive2
520use umount /root/newdrive
521mount /dev/sdb2/mnt/drive2
522
523
5247.6
525Practice Exam
526Question: Convert the file system of /dev/sdb3 from ext2 to ext3
527tune12fs -j /dev/sdb3
528Question: list all files and direcs in badams
529du -ac /home/badams
530
5317.7
532Lab #1:
533Use the quota command
53418432, 20480, 500, 550
535
536Lab #2:
537Use repquota -a
538root, 150, 100, 20480, wadams
539
540Lab #3:
541If quotas are off, use command:
542 quotaon /
543
544Lab #4: increase schan to 1048576
545edquota -u schan
546i
5471048576 (delete soft insert)
548same for hard insert
549press esc
550:wq
551repquota -a
552
5537.8
554Lab: give bcassini ownership, give group, then return group ownership
555chown -R bcassini:hr /hr
556chgrp mgmt1 /hr/personnel
5577.9
558commands:
559chmod 755 /hr
560chmod g+w /hr/*, then ls -la /hr to verify
5617.10
562commands:
563umask 007
564chmod u+s /usr/bin/xmms
565for removing, u-s
566then for SGID, g-s
5677.12
568CREATE A COMPRESSED ARCHIVE
569to extract, use tar -xzf
570
571
572chapter 7
573Type the full device file name for the second partition on the hard drive with the lowest ID number?
574(typed)
575/dev/sda2
576Type the full device file name for the first partition on the hard drive with the third lowest ID number.
577(typed)
578/dev/sdcl
579
580(pay attention to partitions vs drives)
581Which of the following device file names represents the second local terminal on the system?
582/dev/tty2
583(not ttyS2)
584What is the file path and name of the directory that contains device files for hard drives, optical drives, and USB devices?
585(typed)
586/dev
587You have put a new hard disk in your system and created two primary partitions (sdb1 and sdb2) and one extended partition (sdb3). You have just formatted sdb1 with ext3 and sdb2 as a swap area. When you try to format sdb3 as a swap area, you are unable to. What is the problem?
588You cannot format an extended partition.
589You have added a second hard disk to your Linux system. Which of the following commands will allow you to partition the new drive?
590fdisk /dev/sdb
591You want to view partition information for your sda device. Which commands could you use to view the partitions defined on sda? (Select two.)
592fdisk /dev/sda, then press p
593
594fdisk -I
595You have a system with a single hard disk. You add a new hard drive to your system. Which of the following commands would you use to partition the new drive?
596fdisk /dev/sdb
597Which hexadecimal code represents an extended partition?
5980x85
599How many logical partitions can you create on an extended partition?
600Unlimited
601How many primary partitions can you create on a single hard disk drive?
6024
603You have installed a new blank hard drive on your Linux system. This is the second drive on the system so it is represented in the file system by the /dev/sdb file. You need to create GUID partitions on this drive. What command do you use to start up the GUID disk management utility to create partitions on the /dev/sdb drive?
604(typed)
605gdisk /dev/sdb
606With fdisk, you can create a maximum of 4 partitions per disk. What is the maximum number of partitions per disk that can be created using gdisk?
607128
608You have just used the gdisk utility to create 8 partitions on a new hard drive. Which of the following describes the partitions you have just created?
609All 8 partitions are the same. They are just partitions. There are no primary, extended, or logical partitions.
610What is the name of the partition management utility that will both create GUID partitions and create file systems on those partitions?
611(typed)
612parted
613Which partition management utility can be used to define and change various different GUID partition configurations without committing the configuration to the disk until the w command is used?
614gdisk
615You are preparing to use a logical volume with LVM. Which of the following commands initializes a physical volume?
616pvcreate
617You are preparing to use a logical volume with LVM. Which of the following commands creates a volume group named backup on the third disk in the system?
618vgcreate backup /dev/sdc
619(not: vgcreate /dev/sdc backup)
620You are using LVM on your Linux system to manage the existing volumes. After adding and initializing the fourth hard drive to the system and creating a physical volume, what command should you use to add it to the backup volume group?
621(typed)
622vgextend
623
624("add")
625You are using LVM on your Linux system to manage the existing volumes. What command do you enter to scan for logical volumes on the system?
626(typed)
627Ivscan
628You are using LVM on your Linux system to manage hard disk partitions. What command do you enter to scan for physical volumes on the system?
629(typed)
630pvscan
631You need to create a logical volume named video in the home volume group and give it 2 TB of disk space. Which command would you use to complete this task?
632Ivcreate -L 2T -n video home
633(-n <name> <in volume>)
634After creating logical volumes with LVM, what are the next steps you need to do?
635Create file systems on the volumes and mount them.
636You have added a third hard disk to your Linux system. What command would you use to initialize a physical volume on this disk for later use by the Logical Volume Manager?
637(typed)
638pvcreate /dev/sdc
639
640(Don't forget the drive)
641During the Linux installation process you are asked to choose the file system type for your partitions. Which is the most common Linux file system to choose?
642Ext3
643You are assembling a workstation. The system requirements show that this system will be used primarily to store documents of small size. What is the best Linux file system to install?
644Ext4
645Which of these Linux file systems support journaling? (Choose three.)
646Ext3Ext4XFS
647You have successfully partitioned the forth hard drive into 2 primary partitions. You need to format the second partition with the ext3 file system. Which command will work?
648mke2fs -j /dev/sdd2
649(mke2fs= Ext, -j=ext3 for journaling )
650Which of the following commands will create an ext2 file system on the first primary partition of the third hard drive? (Choose two.)
651mkfs -t ext2 /dev/sdc1
652
653mke2fs /dev/sdc1
654
655(pay attention to spelling... answers are tricky)
656You created a swap area on sda3, but it is not activated. Which command should you use to activate the swap partition?
657(typed)
658swapon /dev/sda3
659You have a Linux system with two activated swap partitions: sda3 and sdb2. Which of the following commands can you use to deactivate the sda3 swap partition?
660swapoff /dev/sda3
661(just sda3)
662Which file system is a FAT32 file system for Linux?
663(typed)
664VFAT
665
666(caps)
667You need to create an ext4 file system on the first partition on the second hard disk drive. What command should you enter at the command prompt?
668(typed)
669mkfs -t ext4 /dev/sdb1
670
671(pay attention to disk vs partition)
672Which of the following is not true regarding mount points?
673Mount points use the partitions represented by device files located in the /lib directory.
674You have partitioned and formatted a new hard drive, sdc. You want to mount the first partition on sdc to directory /mnt/newdisk. Which command will perform the mount correctly?
675mount /dev/sdcl /mnt/newdisk
676(pay attention to paths)
677You are preparing to mount a device local to your system. Which directory holds the device files?
678/dev
679Partition /dev/sdb2 is mounted to /mnt/temp. You need to unmount /dev/sdb2. Which commands would you use? (Choose two.)
680umount /mnt/temp
681umount /dev/sdb2
682A user is trying to access a file system mounted at /mnt/sdbl but receives an error No such file or directory. Which commands can you use to see the current mount points? (Choose two.)
683df
684
685mount
686A number of new file systems have been added to the server and you want them to be active now. You also do not want to bring the server down. Which command makes the changes active?
687mount -a
688(-a forces a reread...?)
689You want to mount a number of file systems each time the system is brought up. Which configuration file should hold the configuration information for the file systems to be mounted?
690/etc/fstab
691Yesterday you created a new swap area for your system. Today, after rebooting the system, you find the swap area is not mounted. What should you do to ensure the swap area is mounted each time the system boots?
692Edit /etc/fstab and add the swap partition.
693Which file shows the currently mounted volumes?
694/etc/mtab
695(mount tab)
696You have added several new hard disks to your system. After partitioning and formatting you have modified a configuration file to mount these new file systems automatically. You want to document the change you made. What file would you document?
697/etc/fstab
698You are trying to umount /dev/sdd3 but are receiving a device is busy error message. What can you do to try to unmount the file system? (Choose all that apply.)
699Find and close any open files on the file system, and try to unmount again.
700Make sure your current working directory is not on the file system and try to unmount again.
701You need to mount the CD-ROM device to the /media/cdrom directory. What command should you enter at the command prompt?
702(typed)
703mount /dev/cdrom /media/cdrom
704Which of the following directories is specified by Filesystem Hierarchy Standard (FHS) as a mount point for removable media, such as USB storage media, DVDs, CD-ROMs, and Zip disks?
705/media
706(not /mnt)
707You need to configure your Linux system to allow only the root user account to mount the CD-ROM device. Which of the following options should you add to the /etc/fstab file?
708/dev/cdrom /media/cdrom -t iso9660 ro,nouser,noauto
709
710(Device, Mount pnt, type, options)
711(nouser= root only)
712What is the full path and filename of the file that contains the file system table for a Linux system?
713(typed)
714/etc/fstab
715You are requested to help a user who reports that he has no more local storage space. You go to his system and log in as root user. Which command will display the available disk space on all partitions? (Choose two.)
716df
717df-h
718You have created a separate partition for the sales team and mounted it to the /sales directory. The team is about to begin a new project, and they want to make sure there is enough disk space to hold upcoming files. Which command will show you the amount of free space?
719df /sales
720You are asked to help a user who is complaining that file system errors are being reported during boot up. When you reboot the user's system you see errors on sda2. You want to check the file system on sda2 and fix the errors. What can you do?
721Change to single user mode and run fsck /dev/sda2.
722(Have to change to Single User mode)
723Which command allows you to use an alternative superblock when the primary superblock has been corrupted?
724e2fsck -b 16385 /dev/sdal
725(enhanced fdck)
726You need to convert the file system of /dev/sdb3 from ext2 to ext3 without affecting the data on the drive. What command and option should you enter at the command prompt?
727(typed)
728tune2fs -j /dev/sdb3
729
730(-j= journaling, not data impact)
731What is the effect of the tune2fs -j /dev/sdbl command?
732Converts the /dev/sdbl device to ext3.
733(-j= journaling)
734You suspect your /dev/sda3 partition is in need of repair. Which of the following e2fsck options will repair the errors without any interaction from you?
735-p
736(-p= no questions asked)
737You have an xfs file system in your Linux computer. You need to display the XFS file system parameters, such as the block size and inode data structures. Which of the following commands should you use? (Select two. Each answer is an independent solution.)
738xfs_info
739xfs_growfs -n
740You have an XFS file system in your Linux system represented by /dev/sdb1. You need to copy all the filenames on the drive to the /reviewxfs file. You must be able to read the filenames in the /reviewxfs file. Which of the following commands should you use?
741xfs_metadump -o /dev/sdbl /reviewxfs
742(-o= shows filenames)
743Which command can you enter at the command prompt to list all files and directories in the badams home directory along with a file size and a total amount of space taken up by the directory?
744(typed)
745du -c /home/badams
746
747(-c= lists a total amount of space used in dir)
748Your ext3 file system has experienced a significant amount of corruption. To examine the file system, you want to use the debugfs utility. Which debugfs option should you use to examine the file system?
749-c
750(-c= catastrophic mode)
751You are inspecting the superblocks and block information on your file system. You need dumpe2fs to display only the blocks that are reserved as bad in the file system. Which option should you use?
752-b
753(-b= bad)
754You are setting up disk quotas for users and groups on the /home directory. What mount options do you need to include in the entry for mounting the / home directory in the /etc/fstab file?
755userjquota=aquota.user and grpjquota=aquota.group
756(remember the j in the middle = journaling)
757What is the name of the package that must be installed if you want to use disk quotas on your Linux system?
758(typed)
759quota
760Which command should you enter at the command prompt to change the quota settings for the gshant user?
761(typed)
762edquota -u gshant
763Which of the following commands will open the quota file for a specific user?
764edquota -u
765(open = edit file)
766Which of the following statements best describes the function of the repquota /home -vu command?
767A summary of disk usage and quotas is displayed for those users who have files within /home.
768(not current user's quota limits)
769After creating the aquota.user and aquota.group files in the /home directory, what command do you enter to enable quotas for the /home directory?
770(typed)
771quotaon /home
772
773(home directory)
774Which command should you enter at the command prompt to display the current user's quota limits and disk usage?
775(typed)
776quota
777
778(not rep)
779Which repquota option will give quota limits and disk usage for all file systems listed in /etc/mtab?
780-a
781You need to implement disk quotas on your Linux system. You need the quotas on the / directory. What is the full path and name of the file that must be edited to implement quotas for users and groups?
782(typed)
783/etc/fstab
784Which command will display the disk usage and quota limits for the development group?
785quota -g development
786What would you enter at the command prompt to change the group ownership for the devstyle.txt file to rand in the present working directory?
787(typed)
788chown .rand devstyle.txt
789Which of the following commands make sales the group owner of the /sales/report file? (Select two. Each answer is an independent solution.)
790chown :sales /sales/report
791
792chown .sales /sales/report
793
794(chgrp, not chgroup)
795You need to see who has permissions to the sales_projection_q2 file. You use Is -I sales_projection_q2 and get this information:
796
797drwxr-xr-x 22 pclark acct 4096 Jun 19 15:01 sales_projection_q2
798
799Who is the user shown as owner of this file? (Note: your answer is case-sensitive)
800
801What group is shown as owner of this file? (Note: your answer is case-sensitive)
802
803(typed 2 parts)
804pclark
805
806acct
807You use Is -I /home/sales/sales_projection_q2 and get this information:
808
809drwxr-xr-x 22 pclark acct 4096 Jun 19 15:01 sales_projection_q2
810
811Which command will change the user owner to jyoung and the group owner to sales?
812chown jyoung:sales /home/sales/sales_projection_q2
813You must change ownership of a script called myscript so that only the user owner has read/write access to it and only the user owner and group owner have execute permissions. Which of the following commands would accomplish this?
814chmod 750 myscript
815There is a directory called projects owned by the user cmarcela and the group rd. cmarcela has left the company. You need to give ownership of the projects directory, its files, and subdirectories to the user ebates, who is a member of the mgmt group. Which command should you use to change the user ownership?
816chown -R ebates projects
817(just the user)
818Which set of permissions represent the minimal permissions required to allow a user to list the contents of a directory?
819r-x
820You have a critical file called yearend.xls. You want to set file permissions so that only the owner of the file can modify it and only group owners can read it. Which permission listed below will accomplish that?
821-rw-r----- 1 george acctg 26256 June 1 04:16 yearend.xls
822You are called into the office of a newly hired manager. He has copied a file from his old place of work onto his new workstation, but is now receiving an error message that access is denied each time he tries to access the file. He is not the owner of the file, and not a member of the group the file is associated with.
823Which of the following represents the least set of file permissions needed for him to be able to read and write to the file?
824666
825
826(read + write)
827A user calls the help desk. Each time he creates a new text file, permissions of 640 are applied to the file and he must use chmod to set them to 644. What command should you enter in the user's profile to set the default permission for newly created files to 644?
828umask 0022
829(file default is -rw-rw-rw-)
830While reading about file system permissions in Linux you discover that the default permissions assigned to new files when they are created are rw-rw-rw- (666 octal) and new directories are rwxrwxrwx (777 octal). However, when you create a new file in a directory called /data the permissions assigned are rw-r-r—. Why is this?
831The umask must be set to 0022 and therefore block the write permission for the group owner and everyone else.
832You need to create a large number of files and would like to ensure that you, the user owner, are the only one that has read and write permissions to the files. The files will be located in a number of different directories that already contain files that you don't want their permissions modified. How could you create these files with the correct permissions using the least amount of effort?
833Type umask 0066 to change your umask.
834(you are going to "create them")
835What is the typical default umask value?
836022
837You need to set the SUID permission on a file named rider. Which of the following commands will accomplish this?
838chmod 4777 rider
839A file named acctg needs to have the SGID permission set on it while keeping all other permissions at their present value. Which of the following commands will accomplish this?
840chmod g+s acctg
841
842(category+permission: Group+Set ID)
843(Not s+g)
844You have an application whose owner is root but you want all users to execute the application with root user permissions. Which of the following examples shows correct usage of the SUID flag?
845-rwsr--r-- 3 root sys 73748 Nov 2 2005 /usr/bin/applicationx
846(instead of -rwx-r--r-- 3... | x -> s)
847You have an application whose group is sys but you want all users, whether or not they are members of the sysadmin group, to execute the application with sysadmin group permissions. Which of the following examples shows correct usage of the SGID flag?
848-rwxr-sr-- 3 root sysadmin 73748 Nov 2 2005 /usr/bin/applicationx
849(not -rwxr-sr-s... Not sure why...)
850Setting the SUID flag is a powerful and useful feature. It can have weaknesses associated with its use. Which of the following statements identifies a weakness?
851Setting the SUID flag for an application or process owned by the root user is a potential security hole.
852(They don't become root, just run as root)
853Which of the following special permissions will prevent a file's deletion by anyone except the file owner?
854Sticky Bit
855(value of 1xxx)
856You have just installed a new program that will be used by all users on the computer. After installation, you log in as a regular user and you try to run the program. The program stops and displays the following error:
857
858Error: not running as root
859
860What should you do so that all users can run this program?
861Set the SUID on the program.
862You are the team lead for a marketing project. Only the members of the team3 group should have read/write permissions to a document called project_data.doc, however, you want to ensure that no one on the team will delete the document by accident.
863
864Your user name is bsmith.
865A long listing of the file is as follows:
866
867-rwxr-xr-x 1 bsmith team3 7260 June 22 2004 project_data.doc
868
869Which of the following commands would accomplish this?
870chrnod 1664 project_data.doc
871You want to archive some configuration files to the floppy drive. You are using the cpio utility. Which line will create the archive on the floppy?
872Is /etc/*.conf | cpio -ovd > /dev/rfd0
873(has to have the >)
874You want to restore files with the extension .cfg from an archive called configs.cpio. Which command will perform the restore?
875cpio -ivd "*.cfg" < /mnt/hdd2/configs.cpio
876(cpoi command "file type" < location)
877You have a tape archive mounted in /dev/rmt12. You need to get a list of the file contents. Which command will list the contents?
878tar -tf /dev/rmt12
879(-t= lists archive content, -f= file)
880You have a SCSI tape drive st0. You want to backup the contents of /var/oracle. Which command will perform the backup?
881tar -vcf /dev/st0 /var/oracle
882(tar command "Destination" "Desired Backup")
883You need to backup Jane's files in her /home/user/jane directory. Which command will create an archive in the /root directory? (Select two.)
884tar -czvf /root/jane.tgz /home/user/jane
885
886tar -cvf /root/jane.tar /home/user/jane
887
888(tar "To" "From")
889(-z=gz, -j=bz, -J=xz)
890You need to restore a file, yearend.xls, from the archive 013004.tar.gz'm the backup directory. The file needs to be restored to /home/accounting. Which command will perform the restore?
891tar -xzvf /backup/013004.tar.gz /home/accounting/yearend.xls
892(needs the -z for decompression)
893Which utility allows you to make an exact copy of a file?
894dd
895(not: tar, cpio, cp)
896You are compressing a file with the tar utility, but you need to ensure you can uncompress the file with the bzip2 utility. Which tar option should you use during the file compression?
897-j
898(tar -z=gz, -j=bz, -J=xz)
899You need to view the files within /home/gshant/expfile.bz2 , but you want to leave the compressed file unchanged. What bzip2 option should you use?
900(typed)
901-k
902
903(not the entire command)
904(bzip -k filename= keep orig file unchanged)