· 8 years ago · Apr 04, 2018, 06:00 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/root/ni
36Which of the following options is the standard shell for most Linux computers?
37Bourneagain shell (bash)
38What would you enter at the command prompt to start a new Bourne-again shell (bash) session?
39(typed)
40bash
41What command should you enter to see a list of all the commands you recently used at the command prompt?
42history
43You 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?
44(typed)
45exec ./myapp
46What is the result of the uname -a command?
47All system information is displayed on the screen.
48What would you enter at the command prompt to display the present working directory?
49(typed)
50pwd
51Which of the following commands could you use to search man pages for a specific keyword? (Select three.)
52aproposwhatisman -k
53You 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?
54(typed)
55man uname
56What command can be used on most Linux distributions to find the directories where the man pages are kept?
57(typed)
58echo $MANPATH
59Following 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?
60DESCRIPTION
61If you are viewing the contents of a man page, which key can you press to get back to the beginning of the page?
62
63(typed)
64home
65Which key combination should you press in vi to save the file you are working on and quit?
66:wq
67You need to create a new text file with the name network, txtin the current directory. Which command starts vi and creates the file?
68vi network.txt
69You 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?
70:q!
71A 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?
72(typed)
73#82
74After opening a file in vi, you want to switch from command mode to command line mode. What key should you enter?
75(typed)
76:
77You 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.)
78Press EscType :wq
79What are two methods to exit vi from command mode? (Select two. Each answer is an independent solution.)
80Type :wqType ZZ
81Match the vim mode on the left to the correct definition on the right.
82
831) 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
84
852) The mode that works with the file system. Use it to save files after editing them.
86
873) The mode that vim uses to write and edit text in the file.
881) Command mode
892) Command line mode
903) Edit mode
91What command would you enter while in vi command mode to find the term Sami
92(typed)
93/Sam
94While 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?
95p
96What command would you enter while in vi command mode to copy an entire line of text?
97
98(typed)
99yy
100Which of the following commands will cut an entire line from a file while in vi command mode?
101dd
102You 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?
103O
104Match the command on the left with the description on the right to navigate while in vi command mode.
105
1061) Move the cursor up a line.
1072) Move the cursor one space to the left,
1083) Move the cursor one space to the right.
1094) Move the cursor down a line.
1101) k
1112) h
1123) l (lower L)
1134) j
114Which of the following commands will create a shortcut to the tail -f /var/log/messages command?
115alias sysmesg="tail -f /var/log/messages"
116Which command will display a list of the currently defined aliases on the system?
117(typed)
118alias
119What commonly predefined alias is configured to run the Is -I command?
120
121(typed)
122ll
123You must do which of the following to define a persistent alias?
124Add the command defining the alias to the appropriate shell configuration file.
125The 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:
126• cd /home/mbrown/logs
127• Is -al
128She 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?
129
130(typed)
131Alias logcheck="cd /home/mbrown/logs;ls -al"
132
133(NO SPACE between ";")
134You need to set the COMP variable to the value 1745. Which command will set the variable so it is available to other shell programs?
135export COMP=1745
136Two 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?
137env
138Which of the following statements best describes the PATH environment variable?
139It contains the directory prefixes used to search for programs and files.
140You 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?
141PATH=$PATH:/sbin/special
142What 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?
143
144(typed)
145PATH=$PATH:/sbin/custom; export PATH
146Which command shows the value of the LANG environmental variable currently set for the language the operating system uses?
147echo $LANG
148You 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?
149echo $HISTSIZE
150Which of the following presents the greatest security risk?
151The PATH statement includes . (period).
152Which command will display all the environment variables on the system?
153
154(typed)
155set
156
157I think it is = env?
158Which command will display only the environment variables applied to child sessions?
159
160(typed)
161env
162You recently used the HOST=FS4 command. What command should you use to make the environment variable to apply to all child sessions?
163export HOST
164Which environment variable affects the number of past commands used in the current shell session?
165
166(typed)
167HISTSIZE
168Which of the following commands will configure the shell to retain 300 recently-used commands in the ~/.bash_history file for multiple shell sessions?
169HISTFILESIZE=300
170All 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?
171/etc/profile
172A 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?
173.profile
174Which of the following files would you use to create aliases that are applied when a specific user starts a BASH session? (Select two.)
175~/.bashrc~/.profile
176After 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?
177~/.bash_profile
178Your 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?
179~/.bash_login
180You 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?
181myscript >>testfile.txt
182What will be the effect of the following command? Is -I /usr/bin >> /tmp/list.txt
183The contents of the /usr/bin directory will be redirected into a file called /tmp/list.txt, inserted after previous contents of the file.
184You 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?
185Is -s> Friday 2>&1
186Which of the following commands will give the same results as cat < turbo?
187Cat turbo
188Which of the following commands sorts the contents of wordlistl and wordlist2 and sends the result to standard output?
189cat/usr/wordlistl /usr/wordlist2 | sort
190Which symbol uses the output of one command as the input of another command?
191
192(typed)
193|
194Which command reads from standard input and writes to standard output and files?
195
196(typed)
197tee
198Which 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?
199cat/usr/wordlistl /usr/wordlist2 | sort | tee sortedwordlist
200Which command overcomes the 128 KB shell command size restriction by breaking up long lists of arguments?
201
202(typed)
203xargs
204Which of the following commands redirects standard output to standard error?
205cat txtfile 1>&2
206You 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?
207mkdir -p /var/oracle/database/9i
208In 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?
209rm -rf backup
210You need to make an expanded listing of all the files in /etc. Which command will produce the listing?
211ls -al /etc
212You 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?
213
214(typed)
215ls -a /home/jerrys
216Which 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.)
217cp -r /temp /home/gshantcp -R /temp /home/gshant
218The /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?
219
220(typed)
221rmdir smp
222The /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?
223
224(typed)
225rm -r smp
226Which of the following commands combines three files into a single text stream?
227cat
228You 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.
229cp /mnt/scdO/letter.doc /root
230Which command would you use to rename the /home/pmallory/reports file to reports.bak?
231mv /home/pmallory/reports /home/pmallory/i'eports.bak
232Which command would you use to move a file from one location to another?
233mv
234Which command prints the attributes of a /boot/grub/grub.conf file?
235Isattr /boot/grub/grub.conf
236Which of the following commands will change the /home/gshants/smile file's modification and last accessed times to the current time?
237touch /home/gshants/smile
238What would you enter at the command prompt to display a file's type?
239
240(typed)
241file
242You want to view the contents of a directory, but the output of the Is -I command scrolls beyond the limit of one console window.
243Which of the following commands would allow you to see the full listing of the directory?
244Is -I | less
245Which of the following would be the result of the command In -b /v/filel /data/filel?
246A copy of the file ~/filel would be placed in /data.
247You 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?
248The symbolic links would still exist in your home directory but they would now be broken.
249Drag the permission string on the left to the category on the right. (Tip: Some permission strings will not be used.)
250
2511) Soft link
2522) Hard link
2531) Irwxrwxrwx
254
2552) -rwxr-xr-x
256Which of the following is not a characteristic of symbolic links?
257Valid inode for the file data even if the original file is deleted.
258Which of the following is not a characteristic of hard links?
259Distinct inode
260After using the Is command in the current working directory, you notice the following files:
261Irwxrwxrwx 1 root root 4 2010-11-05 myfile ->
262
263shantsgems -rwxr-xr-x 1 root root 382 2010-10-05 shantsgems
264What is true about the files?
265myfile is a symbolic link to shantsgems.
266What is the full path to the directory that contains data files that change constantly, including email, print jobs, and proxy cache files?
267(typed)
268/var
269Which path represents the root directory?
270/
271Under the Filesystem Hierarchy Standard (FHS), what is the full path to the directory that contains the device files for a Linux system?
272
273(typed)
274/dev
275Under the Filesystem Hierarchy Standard (FHS), which directory contains information about the system state and processes?
276/proc
277Which directory is the home directory for the root user account?
278/root
279Which two statements best describe the purpose of the Filesystem Hierarchy Standard (FHS)?
280During installation, software can predict where to place configuration files.
281Individual users can predict where to find system configuration files.
282What is the full path to the directory that holds the man files on the system?
283
284(typed)
285/usr/share/man
286Which of the following commands finds files with the .txt extension in the /home/gshant directory?
287find /home/gshant -name
288You 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?
289
290(typed)
291find -size +300k
292Which statement describes file globbing?
293Using wildcards to match specific files.
294You 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?
295grep -v Karen blue_and_gold
296-v = not matching
297Which 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?
298grep those /etc/diet/config
299You 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?
300grep -e dblair /etc/group
301Which of the following files will be displayed when using the egrep exhibit[0-9]+ ~/samps command? (Select two.)
302exhibit125
303exhibit1
304Which of the following commands is the fastest method to search a file for fixed strings, rather than regular expressions?
305fgrep
306You 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.
307Which regular expression should you use with grep?
308"g...y$"
309Which 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?
310find / -name 'blue' -o -name 'gold"
311You 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?
312
313(typed)
314which photorec
315You 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?
316
317(typed)
318/ect/updatedb.conf
319Which of the following files would not be found by the locate -i LibraryFines.csv command?
320libraryfines.csv1
321-i = disables case sensitivity.
322Which single command should you use to find the path and manual pages for the mycustomapp program?
323whereis mycustomapp
324After 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?
325
326(typed)
327updatedb
328
329An 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)1) userdel -h bfulin2) userdel bfulin3) userdel -r bfulin4) userdel bfulin;rm -rf /home/bfulin
3303) userdel -r bfulin4) userdel bfulin;rm -rf /home/bfulin
331What would be the outcome of the following command?
332userdel -r jjones
3331) The user account, jjones, would be deleted along with jjones' home directory.
3342) The user jjones' home directory would be deleted, but the user account would still exist.
3353) The user account, jjones, would be deleted, but jjones' home directory would be left untouched.
3364) The user account, jjones, would be deleted along with jjones' home directory and all files owned by jjones.
3371) The user account, jjones, would be deleted along with jjones' home directory.
338Which useradd option displays the default values specified in the /etc/default/useradd file.
339-D
340A 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?
3411) usermod -s /bin/bash brandon
3422) usermod brandon /bin/bash
3433) useradd brandon /bin/bash
3444) userchange -a brandon /bin/bash
3451) usermod -s /bin/bash brandon
346You 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)
347passwd -S gshant
348Which 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)
349/etc/skel
350One 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?
3511) usermod -l kscott kjones
3522) usermod -u kscott kjones
3533) usermod -u kjones kscott
3544) usermod -l kjones kscott
3554) usermod -l kjones kscott
356Which of the following utilities would you typically use to lock a user account? (select two)
3571) passwd
3582) useradd
3593) usermod
3604) userdel
3611) passwd3) usermod
362You 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)
363etc/default/useradd
364Which file stores BASH preferences for the gshant user account? (enter the full path)
365/home/gshant/.bash_profile
366You 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.
367You 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?
3681) /etc/skel/.bash_logout
3692) ~/.bash_logout
3703) ~/.bash_profile
3714) /etc/profile
3721) /etc/skel/.bash_logout
373You 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?
3741) usermod -u joer
3752) usermod -d joer
3763) usermod -l joer
3774) usermod -L joer
3784) usermod -L joer
379A 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?
3801) userdel -r larry
3812) userdel -home larry
3823) userdel larry
3834) userdel -h larry
3841) userdel -r larry
385You need to create a user account with these specific parameters:
386Use pmorrill as the login name.
387Use Paul Morrill as the comment.
388Use /home/pmorrill_temp as the home directory.
389Use 683 as the UID.
390Which command should you use?
3911) useradd pmorrill -c Paul Morrill -d /home/pmorrill_temp -u 683
3922) useradd -c Paul Morrill -d /home/pmorrill_temp -u 683 pmorrill
3933) useradd -d Paul Morrill -h /home/pmorrill_temp -u 683 pmorrill
3944) useradd -c Paul Morrill -d ~/pmorrill_temp -u 683 pmorrill
3952) useradd -c Paul Morrill -d /home/pmorrill_te
396
397
398
399
400
401
402Lab:
403View the currently set environment variables to find the values below
404step 1: use echo $
405
406Lab: You need to view detailed information for the hr directory
407step 1: use the ls-l /
408Lab : What is the name of the hidden directory in /hr?
409step 1: use ls -a / hr
410
411Chapter 6
412Lab #1: UID for the schawla
413View the /etc/password file to answer questions
414Step 1: cat /etc/password
415
416VP of Sales promoted Salman. Identify all groups to which the schawla user belong
417add mgmt 2 and hr
418step 1: groups schawla
419step 2: usermod -aG mgmt2, hr schawla
420step 3: cat /etc/group
421
422
423Lab #2:
424Task:
425Rename user acccount, change the comment field, change the home directory
426Step 1: usermod -c "brenda palmer" -d /home/bpalmer -m -l bpalmer bcassini
427Step 2: cat /etc/password
428Step 3: ls /home
429
430
4316.4
432Lab: Maggie Brown and cflynn, make mbrown a secondary member
433as a secondary group, make mbrown a member of the hrp group. make cflynn a member of the hr grtoup.
434step 1: usermod -G hr mbrown
435step 2: usermod -G hr cflynn
436
437
438lab
439
440 1. To add group: groupadd
441 2. To change the name : -n
442 3. TO delete group: groupdel
443 4. to display: groups
444 5. usermod -G acct, admin lsmith
445 6. to delete group after transfer: usermod -G "" emcmann
446
447
448Chapter 7
449
4507.1
451Lab #1:
452
453 * Which physical disk is the swap area on? 1st
454 * Which partition? 5th
455 * what is the beginning cylinder fot he swap area? (look at sd5 start) 9668
456 * What is the allocated size of the swap area in blocks? 473632
457 * Which physical disk is the boot disk on? 1st
458 * Which disk parition is the booth disk on? 1st
459
460 * Command: fdisk -l
461
462
463Practice Questions
464!!Really skimmed but hopefully helps.
46511 QUESTIONS
466
467 * 1. Type the full device file name for the second partition on the hard drive with the lowest ID:
468
469 * /dev/sda2
470 * Name for first partition on hard drive w/ third lowest ID number
471
472 * /dev/sdc1
473 * Local terminal on the sytem:
474
475 * /dev/tty2
476 * directory contains device files
477
478 * /dev
479 * to partition new drive:
480
481 * fdisk /dev/sdb
482
483
4847.2
485Practice Questions
486!!Really skimmed but hopefully helps.
4875 QUESTIONS
488
489 * What command do you use to start up the GUID disk management utility to create partitions on the /dev/sdb drive?
490
491 * gdisk /dev/sdb
492 * logical volumes?
493
494 * lvscan
495 * physical volumes?
496
497 * pvscan
498 * You 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?
499
500 * Ivcreate -L 2T -n video home
501 * You 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?
502
503 * pvcreate /dev/sdc
504
5057.3
506Lab #1:
507Format the partition: format the /dev/sdb1 partition with the ext3 file system
508Command:
509
510 * mke2fs -j /dev/sdb1
511
512
513Lab #2:
514Format the partitions with the ext4 file system
515Command:
516
517
518 * mke2fs -t ext4 /dev/sdc1
519 * repeat, using /dev/sdc2
520
521
522Lab #3:
523Create a swap partition on /dev/sdb2, and activate
524
525 * command: mkswap, then swapon
526
527
5287.4
529Lab:
530command: mkswap /dev/sdb2
531swapon
5327.5
533Lab #1:
534Create a /mtn/disk directory, then mount it to the directory with the ext3 file system
535
536 * mkdir /mnt/disk
537 * mount -t ext3 /dev/sdb1 /mtn/disk
538 * mount to verify
539
540
541Lab #2: Unmount /dev/sdb2 from /root/newdrive, then mount it to mnt/drive2
542
543 * use umount /root/newdrive
544 * mount /dev/sdb2/mnt/drive2
545
546
547
5487.6
549Practice Exam
550Question: Convert the file system of /dev/sdb3 from ext2 to ext3
551
552 * tune12fs -j /dev/sdb3
553
554Question: list all files and direcs in badams
555
556 * du -ac /home/badams
557
558
5597.7
560Lab #1:
561Use the quota command
56218432, 20480, 500, 550
563
564Lab #2:
565Use repquota -a
566root, 150, 100, 20480, wadams
567
568Lab #3:
569If quotas are off, use command:
570 quotaon /
571
572Lab #4: increase schan to 1048576
573
574 * edquota -u schan
575 * i
576 * 1048576 (delete soft insert)
577 * same for hard insert
578 * press esc
579 * :wq
580 * repquota -a
581
582
5837.8
584Lab: give bcassini ownership, give group, then return group ownership
585
586 * chown -R bcassini:hr /hr
587 * chgrp mgmt1 /hr/personnel
588
5897.9
590commands:
591
592 * chmod 755 /hr
593 * chmod g+w /hr/*, then ls -la /hr to verify
594
5957.10
596commands:
597
598 * umask 007
599 * chmod u+s /usr/bin/xmms
600 * for removing, u-s
601 * then for SGID, g-s
602
6037.12
604
605 * CREATE A COMPRESSED ARCHIVE
606 * to extract, use tar -xzf
607
608
609
610chapter 7
611Type the full device file name for the second partition on the hard drive with the lowest ID number?
612(typed)
613/dev/sda2
614Type the full device file name for the first partition on the hard drive with the third lowest ID number.
615(typed)
616/dev/sdcl
617
618(pay attention to partitions vs drives)
619Which of the following device file names represents the second local terminal on the system?
620/dev/tty2
621(not ttyS2)
622What is the file path and name of the directory that contains device files for hard drives, optical drives, and USB devices?
623(typed)
624/dev
625You 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?
626You cannot format an extended partition.
627You have added a second hard disk to your Linux system. Which of the following commands will allow you to partition the new drive?
628fdisk /dev/sdb
629You want to view partition information for your sda device. Which commands could you use to view the partitions defined on sda? (Select two.)
630fdisk /dev/sda, then press p
631
632fdisk -I
633You 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?
634fdisk /dev/sdb
635Which hexadecimal code represents an extended partition?
6360x85
637How many logical partitions can you create on an extended partition?
638Unlimited
639How many primary partitions can you create on a single hard disk drive?
6404
641You 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?
642(typed)
643gdisk /dev/sdb
644With 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?
645128
646You 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?
647All 8 partitions are the same. They are just partitions. There are no primary, extended, or logical partitions.
648What is the name of the partition management utility that will both create GUID partitions and create file systems on those partitions?
649(typed)
650parted
651Which 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?
652gdisk
653You are preparing to use a logical volume with LVM. Which of the following commands initializes a physical volume?
654pvcreate
655You 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?
656vgcreate backup /dev/sdc
657(not: vgcreate /dev/sdc backup)
658You 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?
659(typed)
660vgextend
661
662("add")
663You 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?
664(typed)
665Ivscan
666You 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?
667(typed)
668pvscan
669You 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?
670Ivcreate -L 2T -n video home
671(-n <name> <in volume>)
672After creating logical volumes with LVM, what are the next steps you need to do?
673Create file systems on the volumes and mount them.
674You 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?
675(typed)
676pvcreate /dev/sdc
677
678(Don't forget the drive)
679During 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?
680Ext3
681You 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?
682Ext4
683Which of these Linux file systems support journaling? (Choose three.)
684Ext3Ext4XFS
685You 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?
686mke2fs -j /dev/sdd2
687(mke2fs= Ext, -j=ext3 for journaling )
688Which of the following commands will create an ext2 file system on the first primary partition of the third hard drive? (Choose two.)
689mkfs -t ext2 /dev/sdc1
690
691mke2fs /dev/sdc1
692
693(pay attention to spelling... answers are tricky)
694You created a swap area on sda3, but it is not activated. Which command should you use to activate the swap partition?
695(typed)
696swapon /dev/sda3
697You 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?
698swapoff /dev/sda3
699(just sda3)
700Which file system is a FAT32 file system for Linux?
701(typed)
702VFAT
703
704(caps)
705You 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?
706(typed)
707mkfs -t ext4 /dev/sdb1
708
709(pay attention to disk vs partition)
710Which of the following is not true regarding mount points?
711Mount points use the partitions represented by device files located in the /lib directory.
712You 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?
713mount /dev/sdcl /mnt/newdisk
714(pay attention to paths)
715You are preparing to mount a device local to your system. Which directory holds the device files?
716/dev
717Partition /dev/sdb2 is mounted to /mnt/temp. You need to unmount /dev/sdb2. Which commands would you use? (Choose two.)
718umount /mnt/temp
719umount /dev/sdb2
720A 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.)
721df
722
723mount
724A 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?
725mount -a
726(-a forces a reread...?)
727You 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?
728/etc/fstab
729Yesterday 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?
730Edit /etc/fstab and add the swap partition.
731Which file shows the currently mounted volumes?
732/etc/mtab
733(mount tab)
734You 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?
735/etc/fstab
736You 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.)
737Find and close any open files on the file system, and try to unmount again.
738Make sure your current working directory is not on the file system and try to unmount again.
739You need to mount the CD-ROM device to the /media/cdrom directory. What command should you enter at the command prompt?
740(typed)
741mount /dev/cdrom /media/cdrom
742Which 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?
743/media
744(not /mnt)
745You 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?
746/dev/cdrom /media/cdrom -t iso9660 ro,nouser,noauto
747
748(Device, Mount pnt, type, options)
749(nouser= root only)
750What is the full path and filename of the file that contains the file system table for a Linux system?
751(typed)
752/etc/fstab
753You 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.)
754df
755df-h
756You 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?
757df /sales
758You 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?
759Change to single user mode and run fsck /dev/sda2.
760(Have to change to Single User mode)
761Which command allows you to use an alternative superblock when the primary superblock has been corrupted?
762e2fsck -b 16385 /dev/sdal
763(enhanced fdck)
764You 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?
765(typed)
766tune2fs -j /dev/sdb3
767
768(-j= journaling, not data impact)
769What is the effect of the tune2fs -j /dev/sdbl command?
770Converts the /dev/sdbl device to ext3.
771(-j= journaling)
772You 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?
773-p
774(-p= no questions asked)
775You 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.)
776xfs_info
777xfs_growfs -n
778You 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?
779xfs_metadump -o /dev/sdbl /reviewxfs
780(-o= shows filenames)
781Which 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?
782(typed)
783du -c /home/badams
784
785(-c= lists a total amount of space used in dir)
786Your 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?
787-c
788(-c= catastrophic mode)
789You 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?
790-b
791(-b= bad)
792You 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?
793userjquota=aquota.user and grpjquota=aquota.group
794(remember the j in the middle = journaling)
795What is the name of the package that must be installed if you want to use disk quotas on your Linux system?
796(typed)
797quota
798Which command should you enter at the command prompt to change the quota settings for the gshant user?
799(typed)
800edquota -u gshant
801Which of the following commands will open the quota file for a specific user?
802edquota -u
803(open = edit file)
804Which of the following statements best describes the function of the repquota /home -vu command?
805A summary of disk usage and quotas is displayed for those users who have files within /home.
806(not current user's quota limits)
807After creating the aquota.user and aquota.group files in the /home directory, what command do you enter to enable quotas for the /home directory?
808(typed)
809quotaon /home
810
811(home directory)
812Which command should you enter at the command prompt to display the current user's quota limits and disk usage?
813(typed)
814quota
815
816(not rep)
817Which repquota option will give quota limits and disk usage for all file systems listed in /etc/mtab?
818-a
819You 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?
820(typed)
821/etc/fstab
822Which command will display the disk usage and quota limits for the development group?
823quota -g development
824What would you enter at the command prompt to change the group ownership for the devstyle.txt file to rand in the present working directory?
825(typed)
826chown .rand devstyle.txt
827Which of the following commands make sales the group owner of the /sales/report file? (Select two. Each answer is an independent solution.)
828chown :sales /sales/report
829
830chown .sales /sales/report
831
832(chgrp, not chgroup)
833You need to see who has permissions to the sales_projection_q2 file. You use Is -I sales_projection_q2 and get this information:
834
835drwxr-xr-x 22 pclark acct 4096 Jun 19 15:01 sales_projection_q2
836
837Who is the user shown as owner of this file? (Note: your answer is case-sensitive)
838
839What group is shown as owner of this file? (Note: your answer is case-sensitive)
840
841(typed 2 parts)
842pclark
843
844acct
845You use Is -I /home/sales/sales_projection_q2 and get this information:
846
847drwxr-xr-x 22 pclark acct 4096 Jun 19 15:01 sales_projection_q2
848
849Which command will change the user owner to jyoung and the group owner to sales?
850chown jyoung:sales /home/sales/sales_projection_q2
851You 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?
852chmod 750 myscript
853There 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?
854chown -R ebates projects
855(just the user)
856Which set of permissions represent the minimal permissions required to allow a user to list the contents of a directory?
857r-x
858You 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?
859-rw-r----- 1 george acctg 26256 June 1 04:16 yearend.xls
860You 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.
861Which of the following represents the least set of file permissions needed for him to be able to read and write to the file?
862666
863
864(read + write)
865A 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?
866umask 0022
867(file default is -rw-rw-rw-)
868While 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?
869The umask must be set to 0022 and therefore block the write permission for the group owner and everyone else.
870You 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?
871Type umask 0066 to change your umask.
872(you are going to "create them")
873What is the typical default umask value?
874022
875You need to set the SUID permission on a file named rider. Which of the following commands will accomplish this?
876chmod 4777 rider
877A 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?
878chmod g+s acctg
879
880(category+permission: Group+Set ID)
881(Not s+g)
882You 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?
883-rwsr--r-- 3 root sys 73748 Nov 2 2005 /usr/bin/applicationx
884(instead of -rwx-r--r-- 3... | x -> s)
885You 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?
886-rwxr-sr-- 3 root sysadmin 73748 Nov 2 2005 /usr/bin/applicationx
887(not -rwxr-sr-s... Not sure why...)
888Setting 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?
889Setting the SUID flag for an application or process owned by the root user is a potential security hole.
890(They don't become root, just run as root)
891Which of the following special permissions will prevent a file's deletion by anyone except the file owner?
892Sticky Bit
893(value of 1xxx)
894You 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:
895
896Error: not running as root
897
898What should you do so that all users can run this program?
899Set the SUID on the program.
900You 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.
901
902Your user name is bsmith.
903A long listing of the file is as follows:
904
905-rwxr-xr-x 1 bsmith team3 7260 June 22 2004 project_data.doc
906
907Which of the following commands would accomplish this?
908chrnod 1664 project_data.doc
909You 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?
910Is /etc/*.conf | cpio -ovd > /dev/rfd0
911(has to have the >)
912You want to restore files with the extension .cfg from an archive called configs.cpio. Which command will perform the restore?
913cpio -ivd "*.cfg" < /mnt/hdd2/configs.cpio
914(cpoi command "file type" < location)
915You have a tape archive mounted in /dev/rmt12. You need to get a list of the file contents. Which command will list the contents?
916tar -tf /dev/rmt12
917(-t= lists archive content, -f= file)
918You have a SCSI tape drive st0. You want to backup the contents of /var/oracle. Which command will perform the backup?
919tar -vcf /dev/st0 /var/oracle
920(tar command "Destination" "Desired Backup")
921You need to backup Jane's files in her /home/user/jane directory. Which command will create an archive in the /root directory? (Select two.)
922tar -czvf /root/jane.tgz /home/user/jane
923
924tar -cvf /root/jane.tar /home/user/jane
925
926(tar "To" "From")
927(-z=gz, -j=bz, -J=xz)
928You 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?
929tar -xzvf /backup/013004.tar.gz /home/accounting/yearend.xls
930(needs the -z for decompression)
931Which utility allows you to make an exact copy of a file?
932dd
933(not: tar, cpio, cp)
934You 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?
935-j
936(tar -z=gz, -j=bz, -J=xz)
937You 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?
938(typed)
939-k
940
941(not the entire command)
942(bzip -k filename= keep orig file unchanged)