Wednesday, April 15, 2009

solaris certification questions dump

1) What two commands will display installed patches (choose 2)?

patchadd -p
uname -p
pkginfo -p
showrev -p


The 'showrev -p' and 'patchadd -p' commands show the current list of installed patches. 'pkginfo -p' displays information about partially installed packages, and the uname -p command is for displaying information about the current system.


2) The system currently has a umask value of 022. What effect will this have?

all directories will be created with the sticky bit
new normal files will be created with 644 permissions
new normal files will be created with 755 permissions
all files and directories will be created with 644 permissions


The umask is set in /etc/default/login and is used to determine the file permissions for newly created files. For newly created directories, the directory's permission is determined by subtracting the umask from 777, which means directories would have 755. Files subtract the umask from 666, which means they'd start out with 644.


3) When using FTP to download files, what option is used to turn off prompting when using mget?

-y
noprompt
-i
noask


The '-i' option is used when starting FTP to turn off interactive prompting for multi-file downloads. The other options are made up and do not exist.


4) What directory contains the path_to_inst file?

The 'path_to_inst' file is located in the /etc directory. The path_to_inst file records mappings of physical device names to instance numbers.


There are five Solaris 8 installation clusters for Sparc, and only four for Intel. Which one of the following exist for Sparc, but not Intel?

entire distribution plus OEM
developer system support
entire distribution
end-user


The Intel version does not include the "entire distribution plus OEM" software group.




5) What vi command will replace all instances of "Sun" in the current file with Sun Microsystems?

:r /Sun/Sun Microsystems/g
:s /Sun Microsystems/Sun/g
:%s /Sun/Sun Microsystems/g
:%r /Sun/Sun Microsystems/g


The answer is ':%s /Sun/Sun Microsystems/g'. When doing substitution in vi, you use either :s or :%s. :%s actually checks the whole file instead of the current line. The 'g' at the end indicates that this is a 'global' operation, which means that instead of replacing the words one at a time, it'll go through the file and make them all at once. The word to be replaced is specified first, and then the word(s) to replace it with.


6) How do you pass the '-r' option to the PROM boot command?

reboot -- -r
reboot -r >> boot
reboot -r | boot
no way to pass between OS & PROM


This is not a well known fact. Options can be passed to the PROM boot command using the 'reboot' command. The answer is 'reboot -- -r'. This would pass the -r option to the boot command, which would result in a boot -r (reconfiguration boot).

7) You just installed the SUNWypr package. How would you verify that it installed correctly?

showrev -v SUNWypr
pkginfo -v SUNWypr
pkgadd -v SUNWypr
pkgchk -v SUNWypr


The 'pkgchk' command is used to verify that a package is installed correctly. 'pkginfo -v' would be used to check the version, there is no -v option for showrev, and pkgadd -v is for tracing the scripts that get executed by pkgadd.

8) What subcommand of the format utility will provide information such as the disk manufacturer, product, and revision?

inquiry
select
label
print


The 'inquiry' menu option shows the vendor, product, and revision. 'label' saves the current disk label, 'select' is for selecting a saved disk label, and 'print' shows the current partition table.



9)Which of the following commands would allow you to make a level 5 dump on the default tape device and verify it--/dev/rmt/0n?

ufsdump 5fv /dev/rmt/0n
ufsdump -l 5 -v >> /dev/rmt/0n
ufsdump -lv 5 default
ufsdump -l 5 -v -f /dev/rmt/0n


'ufsdump 5fv /dev/rmt/0n' is the correct answer. Anything involving redirection in ufsdump is most likely a bogus answer. The 'l' option is for autoload, and has nothing to do with picking an incremental dump level.


10)Using grep, what command will search all files in the current working directory for all lines beginning with "A"?

grep "^A" *
grep * "$A"
grep * "^A"
grep "$A" *


To search all files in the current directory for "A", you would use 'grep "^A" *'. You specify the regular expression being used to search the files, in this case ^A, which indicates that the A needs to be at the beginning of the line.

11)What command creates logical links under the /dev directory which point to the corresponding special files under /devices?

drvconfig
diskscan
mkdskf
disks


The 'disks' command creates the links that point from /dev to the special files located under /devices. The files located under /devices are actually created by 'drvconfig'. The other two commands were made up.


12) Which three characters will take you to command mode from last line mode?

$
:
?
/

The colon, slash, and question mark all take you into last line mode. The dollar sign keeps you in command mode, and merely takes you to the end of the current line.



13) What command is similar in syntax and function to tar, except that it compresses files before creating the archive?

The answer is "gzip". The important thing to realize here is that tar combines everything into an archive, but it does not compress the files.



14) What PROM command allows you to remove a device alias?

devunalias
unset
nvunalias
unalias

The 'nvunalias' command allows you to remove a device alias. The 'unset' command is used from the shell to destroy variables. The 'unalias' and 'devunalias' commands do not exist.


15)Which of the following commands result in file compression? Choose three.

zcat
gzip
jar -c
compress


The 'zcat' command is used to uncompress a .Z file to standard output. The other three commands compress the contents of the files they are executed on. Just in case tar is an option on the actual exam, keep in mind that tar does not compress files, it merely bundles them up in an archive.


16)Given the following line from the process table listing:
root 4425 1381 0 17:07:40 ? 0:00 in.rlogind

How would you kill the in.rlogind process?

The 'PID' (process ID) is the first number in the line for that process in the process listing. In this case, the process ID is 4425, so to kill it, we could type kill 4425, or kill -9 4425. Simply typing 'kill 4425' would send the process the default signal, which is SIGTERM. This is not as powerful as the '-9' (SIGKILL) signal, which is the 'merciless' way of killing a process.


17)Which option to the useradd command will allow you to use a duplicate userid (i.e. -z)?

The '-o' option to the useradd allows a nonunique user id to be used. It is also available for usermod, groupadd, and groupmod. In the group commands, it allows duplicate group ids.


18)Which of the following is true about Solaris shells?

default root shell is ksh
spawned processes always run in the ksh shell
default shell for normal users is Bourne
C programmers must use csh

The answer is 'the default shell for normal users is Bourne'. Root's default shell is also bourne, not ksh. C programmers are not limited to csh; as a matter of fact, limitations in csh mean they often prefer not to use csh. Spawned processes do not always run in a specific shell; it depends on the shell specified for that particular script--otherwise Bourne is used.


19)Which of the following mount commands would not allow files larger than 2 GB to be created?

mount -o limit=2
mount -limit 2
mount -o nolargefiles
mount -o largefiles


The correct answer is 'mount -o nolargefiles'. 'mount -o largefiles' would allow files larger than 2 GB, and the other two answer choices are totally bogus.

20)A user is running csh, and his user directory is /home/bsmith. Which of the following configuration files would be read by csh during the boot and login process? (choose three)

/home/bsmith/.cshrc
/home/bsmith/.login
/etc/login
/etc/.login


CSH would read the /etc/.login, /home/bsmith/.cshrc, /home/bsmith/.login files if they all exist. There is no /etc/login file.


21)You want to perform a backup of filesystem /export/home on the local system. The backup device is located on host Mars and is /dev/rmt/0. What command do you run?

ufsdump 0f mars:/dev/rmt/0 -i /export/home
ufsdump 0c if=/export/home of=mars:/dev/rmt/0
ufsdump 0h mars /export/home
ufsdump 0f mars:/dev/rmt/0 /export/home


The answer is 'ufsdump 0f mars:/dev/rmt/0 /export/home'. When you reference a remote file, you specify the hostname:/filename. The same applies to a remote device. The '0' in 0f indicates that this is a level 0 dump being performed.


22)How do you view ACLs?

showfacl
getacl
getfacl
lsacl


The only real-life command out of the four choices is 'getfacl'. The ACL commands all end in 'facl'. The other 3 choices are all made up.




23)Which of the following commands will take you from command mode to edit mode in VI? (select 3)

I
g
a
A

The 'A', 'a', 'I' would all take you to insert mode. Other keys that will take you to insert mode are 'i', 'o', and 'O'.




24)Which of the following commands give the current run-level?

uname -r
init -r
who -r
last -r


The 'who -r' gives the current run level. 'uname -r' gives the OS revision level, and 'init -r' and 'last -r' give errors because there is no '-r' command for the init and last command.


25)Here are a few files located in rc0.d.
K50utmpd K55syslog K73volmgt
What do the 2 digits after the K indicate?

they do not indicate anything--each script merely requires a unique 2 digit number
They are equal to the PID of the script
they indicate the max number of spawned processes for that script
They indicate priority--what order the scripts will be run


These files are known as sequencer files. The two-digit numbers determine the order in which these scripts are executed. The lowest is run first, the highest number is run last. This is because certain scripts often require other scripts to be run before they can function.


26)Which of the following can you set during a customized install? Choose two.

filesystem layout
user disk quotas
printers
64-bit capability


User disk quotas and printers cannot be set up during a customized install. The answers are '64-bit capability' and 'filesystem layout'.

27)How would you remove the patch 105361-08?

patchadd -d 105361-08
patchdel 105361-08
patchrm 105361-08
patchinfo -d 105361-08


The 'patchrm' command is used to remove patches. Type 'patchrm 105361-08' to remove the 105361-08 patch. Please remember that the '-d' option to the patchadd command is used to make the patching process irreversible, by not creating backups of the files before they were patched. There is no patchinfo or patchdel command.




28)You have an account on host A and host B. How can you download a file from Host A while logged in on Host B without supplying a password?

add host A to your $HOME/.rhosts file on host B
add host B to your $HOME/.rhosts file on host A
have superuser modify the rusers file
add your username to /etc/hosts.equiv


The .rhosts file allows you to specify remote hosts from which a password is not required. The answer is 'add host B to your $HOME/.rhosts file on host A'. To explain this, let's use user bsmith. Adding host B to the .rhosts file in bsmith's home directory on host A means that whenever bsmith tries to use rcp or another 'r' command from host B on host A, he is not asked for a password.


29)Which of the following commands accept the -o option to allow a duplicate userid or group id to be used (select three)?

usermod
adduser
groupadd
useradd


The '-o' option allows duplicate user ids, or group ids to be used. The useradd, usermod, groupadd, and groupmod commands allow this. The adduser command does not exist.


30)What file must be modified to turn on ufs logging automatically for a filesystem when it is mounted?

The logging option must be added to the /etc/vfstab file to enable ufs logging for a filesystem.


31)Which subcommand for the partition menu under the format command loads a predefined label?

The 'select' command loads a predefined label.




32)Which of the following subcommands, from the initial menu for the format command, allows you to select a different disk?

new
disk
menu
current


The 'disk' command from the format menu is used to select a different "current disk". The 'new' command does not exist, and current describes the current disk. The 'menu' command also does not exist.


33)What option to the PROM boot comand is for reconfiguring your device tree?

You would type 'boot -r' to cause the system to boot up, and reconfigure the device tree, so the answer is '-r'. Another way to have the device tree reconfigured, is to type 'touch /reconfigure' from the shell, and then reboot.





34)What does the hash command in FTP result in?

a hash is printed when a block is written during a file transfer
the hash table is updated whenever a file transfer is made
it activates the "hash hotkey"
all transfer requests are stored and transferred in batches


The 'hash' command is a simple command for ftp that results in a hash (#) being printed every time one block of the transfer is complete. A block is typically 1024 bytes in FTP transfers.


35)What subcommand of the format utility will take you to the menu for making partition label changes?

The 'partition' subcommand of the format utility takes you to the partition menu, where you can change the current partition label configuration.

36)What command allows you to change your primary group?

The 'usermod' command allows you to change user information, to include their primary group. Keep in mind that the 'newgrp' command allows you to switch your "current group" temporarily, but does not affect what your primary group is.


37)You see a system administrator reboot one of the servers and then walk away, but all you catch is that he used the "shutdown" command. When you come back later, it is sitting at the ok prompt. What run-level did he shutdown to?

Shutting down to run level 0 is halting the system, and the end result is an ok prompt, so the answer is 0. Run level 5, which is often confused with run level 0, is power-down. Run level 6 would be for rebooting.

38)Which two characters allow you to move up and down in VI?

l
j
k
h


The 'j' and 'k' characters allow you to move 'down' and 'up' respectively. The 'h' and 'l' keys are used to move left and right.




39)What command would provide a list of the contents of the archive abc.tar without extracting the files?

tar cvf abc.tar
tar xvf . abc.tar
tar tvf . abc.tar
tar tvf abc.tar .


The 't' option to the tar command means 'table of contents'. This results in the contents of the file being displayed, instead of any action being taken on the file. The tar file must be specified first, and then the location, in this case '.' (the current directory). The answer is 'tar tvf abc.tar .'.


40)Consider the following command:
#chmod 2666 telephone
Choose 2 answers that are correct.

the assigned group has write permission for telephone
the telephone file is locked
no one has execute permission for telephone
setgid is enabled on telephone


The file "telephone" has been assigned octal permissions of 2666, which means setgid is set, and the assigned rights are read and write for everyone. We know setgid is set because 4000 represents setuid, 2000 represents setgid, and 1000 represents sticky bit. If setgid is set, that means that whenever this command is executed, it is executed as if it had been executed by the group which owns the file. Setuid would mean that it is executed as if the user who owns the file ran it.


41)How do you copy a local file to remotehost?

rcp localfile remotehost
rcp localfile remotehost:/filename
rcp localfile remohost/filename
rcp localfile remotehost:filename


When referencing remote files, use the format hostname:/filename. In this case, the correct answer would be 'rcp localfile remotehost:/filename'.


42)What command would extract the file my.file from the archive abc.tar?

tar xvf my.file abc.tar
tar xvf abc.tar my.file
tar tvf my.file abc.tar
tar cvf abc.tar my.file


The 'x' option to the tar command means 'extract'. This results in the contents of the file being extracted to the specified location. The tar file must be specified first, and then the file being extracted. The answer is 'tar xvf abc.tar my.file'.


43)What vi command copies the next 3 lines and pastes them above the current line, assuming that you are on line 2?

3yyp
3yyP
:2,5m1
3mU


The 'yy' command is for cutting. 'p' is for pasting at the current line, and 'P' is for pasting above the current line.


44)Where do you specify default init level?

The default init level is specified in the /etc/inittab, which is a file that controls process dispatching by init.


45)What command would restore a backup created with ufsdump from the default tape device?

ufsrestore cvx /dev/rmt/0n
ufsrestore << /dev/rmt/0n
ufsrestore -I /dev/rmt/0n
ufsrestore f /dev/rmt/0n


the 'ufsrestore f /dev/rmt/0n' command would be the correct choice. Redirection is not used with ufsrestore. The ufsrestore command is a fairly complex command, and it is recommended that you at least read the man page for it.


46)There is a cdrom connected to controller 0. Which of the following commands would mount the cdrom on mount point /mnt, assuming that the volume management daemon is not running?

mount /dev/dsk/c0t2d0s0 /mnt
mount cdrom /mnt
mount -F cdfs /dev/dsk/c0t6d0s0 /mnt
mount -F hsfs /dev/dsk/c0t6d0s0 /mnt


The answer is "mount -F hsfs /dev/dsk/c0t6d0s0". There are two important things to note here:
CD-ROM access in Solaris uses the HSFS (High Sierra File System) file system.
the CD-ROM is typically given a target address of 6, hence c0t6d0s0




47)Consider the following listing:
#ls -ld
drwxrwsrwx 2 root other 512 Aug 24 2000 test1
Which of the following would remove the setgid?

chmod 0777 telephone
chmod g-s telephone
chmod g-l telephone
chmod 0000 telephone


Looking at this listing, we see that there is an 's' where the 'x' bit for group permissions would normally be set. This tells us that setgid is turned on for this file. Setgid can be added using octal permissions (a value of 2000), but it can only be removed using symbolic permissions. Therefore, the correct answer is chmod g-s telephone. Please note that removing sticky bit or setuid does not have the same limitation.




48)Which of the following commands would you use to create a filesystem using a raw device?

newfs -r c0t0d0s0
newfs /dev/rdsk/c0t0d0s0
newfs /dev/dsk/c0t0d0s0
newfs c0t0d0s0,raw

First of all, newfs requires a raw device. Secondly, raw devices can be identified by their path; they are located in the /dev/rdsk directory. The correct answer is "newfs /dev/rdsk/c0t0d0s0"


49)Which two of the following commands would provide online information about /etc/vfstab?

man -s4 vfstab
man vfstab (5)
man /etc/vfstab
man vfstab


The two correct answers for this question are "man vfstab" and "man -s4 vfstab". 'man /etc/vfstab' would produce no result. Typing 'man -s4 vfstab' would result in the section 4 manpage for vfstab to be loaded. 'man vfstab (5)' is incorrect syntax for specifying the section.


50)What does the noatime option result in when set in the vfstab file?

access time for the file is not modified when the file is read
no restrictions are allowed on when files can be accessed
users cannot change the "last modified" time for a file
it does not allow file-read requests to be interrupted



The 'noatime' option is short for 'no access time' and means that access time for the file is not modified when a file from that filesystem is read.


51)The system is now at the boot prompt due to an interrupt. What command do you run to minimize file system damage?

fsck
sync
boot -r
park


The 'sync' command insures that all file modifications made up to that point are saved to the disk, by flushing all previously unwritten system buffers to disk. 'fsck' is used to diagnose bad disks, park is not a standard solaris command, and 'boot -r' is run when you want to reconfigure the device tree.


52)You want to put all files which were modified in the past 7 days into an archive on /dev/rmt/3. Which of the following cpio commands would do that?

cpio -icdB < /dev/rmt/3
find / -mtime -7 -cpio /dev/rmt/3
find . -cpio /dev/rmt/3
ls -lta | cpio -o 7 > /dev/rmt/3


Please be advised that the cpio command is a fairly complicated command, and you may want to do some reading on it. The correct answer in this case is find / -mtime -7 -cpio /dev/rmt/3. The find command looks for files with a modification time within the last 7 days, and then passes that on to cpio for archival.


53)What type filesystem would you specify when mounting an msdos floppy?

dosfs
fdfs
ufs
pcfs


To mount an MS-DOS floppy, you would use 'pcfs'. UFS is for hard disks, and 'dosfs' and 'fdfs' do not exist.




54)What is the default signal that is sent to the in.telnetd process when pkill is run on it?

TERM
HUP
INT
KILL


The default signal sent by either the kill or pkill command is TERM, also referred to as SIGTERM, or represented by a -15.


55)What single character represents zero or more characters in a regular expression?

In regular expressions, the '*' (asterisk) represents 0 or more characters.



56)Which subcommand for the partition menu under the format command allows you to modify the partition label and prompts you a slice at a time?

label
modify
select
customize

The 'modify' command allows you to modify a disk label, and it will prompt you for a slice at a time. The 'select' command is for loading a saved label, 'label' is for saving the current partition table, and 'customize' does not exist on the partition menu.

No comments:

Post a Comment