Sunday, March 30, 2008

Chapter 7

1. Which of the following are always stored in the /etc/passwd file?
a. encrypted user passwords
b. user home directory locations
c. the default shell that each user uses

2. When you check the /etc/shadow file on your system, you notice that the date of the last password change is 12907. What does this number represent?
b. December 9th 2007

3. You currently use both /etc/passwd and /etc/shadow files to store user account information. What command can you use to consolidate this information into the /etc/passwd file only?
pwconv

4. Which of the following files could you edit to create groups and add members to those groups?
c. /etc/groups

5. Which of the following files are used to obtain default user account settings when you create a user with the useradd command?
a. /etc/login.defs
c.. /etc/default/useradd

6. You have a file called "Policies&Procedures.txt" that you wish to place in the home directories of all newly created user accounts. Where should you place these files?
/etc/default/useradd

7. What command can you use to add the user bob to your system, create a home directory for him, set his primary group to acctg, and give his account an expiry date of May 11, 2006?
useradd -m -g "acctg" -e 2006-05-11 bob

8. After creating the user in question 7, what must you do to allow the user to log in to the system?
create a password for that user.

9. What command can be used to change the UID of the user in Question 7 to 741?
usermod -u 741 bob

10.What two commands below can be used to create the group acctg and add the user bob to it?
b. groupadd acctg
c. groupmod -A bob acctg

11. Which of the following commands may be used to see the current user resource limits for your system?
a. ulimit -a

12. Which of the following fire permissions gives the group owner the ability to edit the file contents?
a.rw-rw-r-x
d.r--rw-r-x

13. Which of the following directory permissions gives the owner the ability to list the contents of a directory?
a. rwxr-x-r-x
b. rwxr--r-x
c. r-xrw-r-x

14. What command could you use to change the owner to bob and the group owner to acctg for the fire /etc/yearend?
chown bob.acctg /etc/yearend

15. What command could you use to change the permissions on the file /etc/yearend to rw-rw-r-- using octal notation?
chmod 661 /etc/yearend

16. What permissions does the system give to new files and directories by default prior to applying the umask?
b. files are 666 and directories are 777

17. What will the permissions be on a new directory if the umask is set to o27?
750

18. Which of the following commands will set the Sticky bit special permission on the directory /public?
a. chmod 1777 /public

19. You have enabled user and group quotas on the filesystem that is mounted to the /var directory. Which files contain the quota limits?
a. /var/aquota.group
b. /var/aquota.group

20. What command can you use to modify the grace period for quota soft limits?
edquota -t

21. Which of the following are journaling filesystems that can be created using the mkfs command?
d. JSF

22. How many partitions can be made on a single IDE hard disk using the fdisk program?
d. 64

23. Which option to the fsck command would you use to check all filesystems listed in /etc/fstab.
-a

24. What command would you use to check a ReiserFS filesystem for errors?
reiserfsck

25. You cannot unmount a filesystem that you had previously mounted to the /mnt directory. What command can show you which users are still using the /mnt directory?
mount

26. What command can you use to list the package in the RPM database that the /etc/hosts file belongs to?
rpm -qf /etc/hosts

27. You have downloaded the source code for a program that you wish to compile. Which command can you use in the source code directory to create a makefile?
b. make

28. What is the first area on your hard disk that typically contains a Linux boot loader?
a. MBR

29. Which of the following boot managers contain an interactive shell?
a. grub

30. You have modified the /etc/lilo.conf file, but your changes have not taken effect. What command must you run?
/sbin/lilo

Sunday, March 16, 2008

Chapter 6

1. Which of the following are valid shells that are available in Linux?
a. /bin/bash
c. /bin/ksh
d. /bin/tcsh

2. Which of the following files are executed when you start another shell following login?
c. ~/.bashrc

3. Which of the following files could you edit to create a variable that must exist in all shells that are started by users on your system?
a. ~/.bash_login

4. You have just edited your ~/.bashrc file and added a line that loads a variable. How can you read this file into your current shell environment?
d. source ~/.bashrc

5. Which of the following may be used to protect the $ character in the phrase $DIR from being interpreted specially by the bash shell?
a . \$DIR

6. You wish to recall a previous command that starts with the letters "cron". After you type the letters "cron" on the command line, what key combination could you use to search the command history for previous commands that start with "cron"?
Ctrl + R

7. Which key may be used to complete the name of a file or a directory on the command line?
b. Tab

8. Which of the following commands can be used to view the contents of the $NOVELL variable?
b. echo $NOVELL

9. What command could you use to create a variable called TEST that is available to child processes in subshells?
export TEST="Good Morning"
bash

10. What function call is used by a shell to create a subshell for program execution.
exec

11. Which of the following commands may be used to view all shell and environment variables on the system?
a. env

12. What command could you use to create an alias called c that runs the clear command in your current shell.
alias c=clear

13. Which of the following files are best suited to storing aliases?
d. /etc/bash.bashrc

14. Which command can be used to view all files in the /etc directory that are three characters long and start with either A or B?
a. ls /etc/[AB]??

15. Which of the following output redirection symbols will not overwrite an existing file?
d. >>

16. What command could you enter at a command prompt to view a long listing of files in the /proc directory and save the stdout and stderr to the file results in your current directory?
ls -l /proc > results 2>&1

17. Which of the following demonstrates correct syntax?
b. command >file
d. command | command

18. To which device file can you redirect stderr in order to ignore stderr completely?
/dev/null

19. Which of the following will run the command echo "I Found It!" only if the command grep localhost /etc/hosts is successful?
c. grep localhost /etc/hosts && echo "I found it!"

20. What command accepts information from stdin and sends it to both a file and stdout?
tee

21. Which key can you use to switch from command mode to insert mode in the vi editor?
b. i

22. Which key sequence in the vi editor will allow you to save your changes and quit?
a. :wq
c. :x
23. What sed command would you use to replace all occurrences of the word mom with dad in the file letter?
sed y/mom/dad/

24. What sed command would you use to delete all lines that begin with a # character in the file /etc/samba/smb.conf ?
sed '1~1d,#' /etc/samba/smb.com

25. What awk command would you use to print the third and fifth fields of the colon-delimited /etc/passwd file?

Sunday, March 9, 2008

Chapter 5

1. Where can you find the detail specifications of FHS?
At www.pathname.com/fhs

2. How long can the total path name to a particular file be in linux (from the root directory)?
d. 4096

3. What directories must reside on the same file system partition as the root directory?
/bin/,/dev/,/etc/, /lib/, and /sbin

4. Which of the following are absolute pathnames?
b. /home/bin
c. /

5. Which of the following devices can be referenced using device files?
a. printers
b. mice
d. hard disk partitions

6. When you do a long listing of the file /dev/fd0 , you notice the following output: brw-rw---- 1 root disk 2, 0 Jun 30 2007 /dev/fd0
Which of the following statements are true regarding this file?
b. The file is a block-oriented device file that has a major number of 2 and a minor number of 0.
7. What device file is used refer to the first partition of your first IDE hard disk?
/dev/hd1

8. What three hidden files exist in user home directories?
.profile, .bashrc, .bash_history.

9. Which directory stores administrative programs?
b. /sbin

10. you are trouble shooting a system problem and believe the there is a duplicate interrupt being used on the system. What file can you view to verify this?
/proc/interupts

11. What command could you type at a command prompt to mount a CD-ROM file-system to the /mnt/cdrom directory?
mount /media/cdrom /mnt/cdrom

12. Which option to the ls command can you use to view a long listing of files in your current directory, including hidden files?
a. -al

13. Which of the following commands can be used to change your present working directory (/etc/sysconfig) to /home/geeko , using a relative path?
b. cd ../../home/geeko

14. What command could you type at a command prompt to view the first 25 lines of the file /etc/hosts?
head -25 /etc/hosts

15. Which option to the tail command is useful when viewing logfiles and why?
-f because it shows a continuously updating list which can be useful if a file is changing.

16. Which key combination can you use to cancel your current command?
c. Ctrl + c

17. Which command could you use to copy the directory /data/secret to the /var directory?
cp /data/secret /var

18. Which command can be used to remove a directory and all of the files within?
c. rm

19. Which of the following commands would you use to undelete a file that was accidentally deleted using the rm command?
There is no way to undelete a file removed with the rm command.

20. What command could you type in a command prompt window to create a new symbolic link called shortcut in your current directory that points to the /etc/inittab file?
ln -s shortcut /etc/innitab

21. Which of the following statements regarding file linking are true?
b. to determine whether a file is hard linked, you can view the link counter in a long file listing.
d. Hard links share the same inode

22. Which command can be used to search the PATH variable for executable programs?
which find exec

23. What command may be used to search the /etc directory for files that are owned by the user geeko?
find /etc -user geeko

24. You are attempting to locate a new file on the file system using the locate command, however no results are displayed. What command could you run to remedy the problem?
updatedb

25. Which command may be used to search the /etc/hosts file for lines that start with 127.0.0.1?
grep -n ^127.0.0.1

26. Which of the following archive utilities must be run in a GUI environment?
b. ark

27. What tar command would you use to create a gzip-compressed archive file called /root/myfile.tar.gz that contains the entire contents of the /opt directory?
tar -cf /root/myfile.tar.gz /opt

28. You have created a script the contains cpio commands used to create a daily backup of your system. What directory could you place this script in to allow the cron daemon to execute it each day?
/etc/cron.daily/

29. After downloading a file, you not that is has a .bz2 extension. Which command could you use to extract the contents of this file?
bunzip2

30. Many file management commands support the -R (Recursive) option. how does this option change the operation of the command?
Recursive will usually include all files within a directory.

Monday, March 3, 2008

Chapter 4 Review Questions

1. What keys can you use in the menu-based YaST interface to navigate between selections?
A. Tab
B. Atl+Tab

2. Which command could you execute at a command prompt to start the user management module?
A. yast users

3. What option to the yast command could you use to display a list of Yast Modules?
yast -1

4. You wish to install another software package using Yast from you SLES installation media. How can you verify that your system has the appropriate prerequisite packages?
d. Right-click the package in YaST and select Verify.

5. How can you change the default source location for packages within YaST?
Software> Change Source of Installation

6. What UID is used by the root user account?
UID 0

7. What is the default Login Shell that is used when you create a new user account using YaST?
kdm

8. What is the default group that new users are assigned to when you create them using YaST?
a. users

9. What two files are modified when you add a new user using YaST?
/etc/passwd
/etc/shadow

10. What file is modified when u add a new group using YaST?
/etc/group

11. Which of the following types of printers can you configure on your system using YaST?
a. usb
b. IrDA
c. Parallel

12. What modem device do you normally specify when configuring a modem using YaST?
/dev/modem

13. Which utilities may be used to connect your computer to an Internet Service Provider using a modem?
b. Kinternet
c. cinternet

14. Which of the following is a valid display name?
c. Hostname:DisplayNumber.ScreenNumber

15. You wish to start a graphical application us the command: application -g 100x90-10+60. What does the -10+60 in this command refer to?
d. The location of the application window from the upper left corner of the screen.

16. Which of the following commands can be used to start the X server, window manager, and desktop environment from a command-line interface?
d. startx

17. What marker in the var/log/XFree86.0.log file indicates values that were obtained from hardware detection?
(--)

18. Which of the following are valid Login Managers in SLES?
a. kdm
b. xdm
d. gdm

19. Which command would you use to connect to a computer across a network in order to run graphical programs remotely?
b. rsh -X hostname

20. Which of the following configuration utilities may be used to configure your X server settings using a text-based interface?
c. xf86config