![]() |
![]() |
![]() |
![]() |
|||||
|
UNIX Questions and Answers
Contents 1 UNIX 1.1. Windows NT is a 32-bit operating system (OS). What does it mean to be a 32-bit OS? 1.2. Describe programs, processes, and threads. 1.3. What is the difference between a thread and a process? 1.4. What is the difference between a lightweight and a heavyweight process? 1.5. What is a fiber? 1.6. What is multitasking? 1.7. Describe synchronization with respect to multithreading. 1.8. Why is it sometimes necessary to synchronize the actions of multiple threads? 1.9. What are mutex and semaphore? What is the difference between them? 1.10. How do you make methods thread-safe? 1.11. What are the disadvantages of using threads? Discuss some problems that can result from incorrect thread programming. 1.12. What is deadlock? How can I eliminate it? 1.13. What is the difference between multithreading and multitasking? What about multiprogramming? Multiprocessing? 1.14. Describe program, process, fork, exec, waitpid. 1.15. What is a fork in UNIX? 1.16. What are the problems with fork? How threads do solves these problems? 1.17. What is a daemon? 1.18. What is a cron job? 1.19. What is a socket? 1.20. What is the main advantage of creating links to a file instead of copies of the file? 1.21. Describe hard link. 1.22. Describe soft link. 1.23. What is the difference between a symbolic link and a hard link? 1.24. Write a command to find all of the files which have been accessed within the last 30 days. 1.25. What is the most graceful way to get to run level single user mode? 1.26. What does the following command line produce? Explain each aspect of this line. $ (date ; ps -ef | awk {print $1}’ | sort | uniq | wc -l ) >> Activity.log 1.27. In UNIX OS, what is the file server? 1.28. What is NFS? What is its job? 1.29. What is CVS? List some useful CVS commands. 1.30. What do these permissions on a file mean? =-rwxr-xr-x 1.31. What is a tar file? 1.32. Describe gzip. 1.33. How do files differ in Windows, UNIX and Mac? 1.34. What is the difference between .so and .a files in UNIX? 1.35. Windows vs. UNIX: Linking dynamic load modules 1.36. How would you find all the processes running on your computer? 1.37. List some UNIX commands and their use. 1.38. How do you get a long listing of all files in a directory sorted in reverse order by time? 1.39. What are shared libraries? 1.40. What is LD_LIBRARY_PATH used for? 1.41. Why was LD_LIBRARY_PATH invented? 1.42. What command can be used to find out idle processes? 1.43. Which command can be used to read from logged data? 1.44. What are the different types of files in UNIX? 1.45. What are regular files? 1.46. What is an i-node? 1.47. Describe Directories and Symbolic Links 1.48. What are Special Files? 1.49. What are signals? 1.50. Describe process-IDs, process groups, and sessions. 1.51. Permissions 1.52. Interprocess Communication 1.53. Versions of UNIX 1.54. How do you list all the files and sub-directories in the file system? 1.55. Write a command to list all of the files in the current directory tree that have a name ending in .c. 1.56. Describe the C compilation process. 1.57. Describe the make process. 1.58. Write a typical makfile. 1.59. What are the guidelines for creating a password? 1.60. What are the guidelines for changing a password? 1.61. Can you really break up the UNIX system? 1.62. Where do you use su command? 1.63. What are the differences between AWK and PERL? 1.64. What is piping? 1.65. What are the common UNIX directories and their contents? 1.66. Describe common UNIX shells. 1.67. What is the difference between cmp and diff? 1.68. What are aliases in UNIX? 1.69. What are environment variables? 1.70. What is the default windowing system used in UNIX? 1.71. What command is used to list the contents of a directory? 1.72. What command is used to display a list of currently running processes? 1.73. What is a login shell? 1.74. What is a UID? 1.75. In what file is the relationship of UID to username defined? 1.76. What command is used to check a filesystem for errors? 1.77. Is there a difference between a file called OUTPUT.TXT (in all caps) and output.txt (all lowercase) in UNIX? 1.78. What command is used to read the manual page for a given command? 1.79. What symbol is used to redirect standard out (STDOUT) to a file? 1.80. What command is used to establish a secure command-line session with another system over a TCP/IP network? 1.81. What file contains the list of drives that are mounted at boot? 1.82. In what file is the default runlevel defined? 1.83. Define and describe TCP Wrappers. What are the reasons for using TCP Wrappers in addition to a host-based firewall? 1.84. What is the advantage of giving a user elevated privileges to certain commands through sudo, as opposed to giving them root access to a system? 1.85. What is the chroot command and why is it important to the security of a system? 1.86. Describe a buffer overflow attack and list possible defenses. 1.87. What is the weakest point in any network or system’s security? What can you do about it? 1.88. Describe a file system integrity tool and explain its importance. 1.89. What is an intrusion detection system and what are some basic flaws in the concept of ‘detecting intrusion’? 1.90. What is “ARP cache poisoning”, and how can it be prevented? 1.91. Describe VPN technology and list some common implementations. 1.92. What is a DMZ and why would you want one? 1.93. What command is used to display the ports that are open on a UNIX system? 1.94. What is the subnet mask for a default Class-C IP network? 1.95. In a standard class C IP network, how many IP addresses can be assigned to hosts? What are the other non-assignable addresses used for? 1.96. What is a MAC address? 1.97. You wish to set up a Linux system as a router between two subnets. You have installed and configured two network cards, each attached to a different subnet. What are the steps that need to occur before the system will act as a router? 1.98. What is an MTU? 1.99. What file determines the DNS servers that are queried when a network request is made? 1.100. What is the difference between UDP and TCP? 1.101. POP vs. IMAP 1.102. How do I know if I should use IMAP or POP? 1.103. Simple Mail Transfer Protocol 1.104. What steps are necessary to configure a Solaris system to participate in an IP network? 1.105. What is TCP sequence number prediction and what can you do to prevent it? 1.106. You have purchased a domain name and setup one of your UNIX servers as a DNS server. What entry must you make in your primary zone file to ensure that email addressed to your domain is sent to the correct mail server? 1.107. Associate these common network services with their default port numbers: Telnet, SSH, FTP, SMTP, DNS, POP3, HTTP, HTTPS, IMAP 1.108. What command will display the routing table on a UNIX system? 1.109. Your UNIX system is able to ping other devices on the local subnet, but it is unable to ping a device outside of the subnet. What could be the problem? 1.110. When you initiate a telnet session to your UNIX system, the connection is established, but there is a 20 second or more pause before you see a login prompt. What could cause this? 1.111. Define and describe the following terms related to disk management under UNIX: Boot block, Super block, Logical block, Inode 1.112. Describe the processes for adding a new hard disk to a UNIX system. 1.113. What is the difference between a regular file system and a journaling file system? 1.114. Define and describe the common UNIX file systems. 1.115. What are the 3 settings in the standard UNIX file permissions model, and how does each apply to files and directories? 1.116. What is the setUID bit and how is it employed? 1.117. Define and describe the cron job scheduling system. What are the fields available to define the time a job will execute? 1.118. Describe the Samba suite of utilities. How are they useful in a heterogeneous environment? 1.119. Describe the package management options available on Linux systems. 1.120. Describe the package management software on Solaris. 1.121. What are three ways to find a file on a UNIX system? 1.122. If /etc/inittab defines your default runlevel as 3, where do your system startup scripts reside? 1.123. You are logged in as root and wish to kill a process with PID #1054. You type ‘kill 1054’ but you still see the process in the process table. Why did the process not die, and what can you do to get rid of it? 1.124. What are the fields defined in the /etc/passwd file? 1.125. What is the purpose of the ‘grep’ command? 1.126. What command is used to display information about the network interfaces on a system? 1.127. The ‘ps’ command lists processes currently running on the system. Identify and describe the following column headers from the output of ‘ps -aef’: UID, PID, PPID, TTY 1.128. In Solaris, what command is used to display the slice information for a particular disk? 1.129. What command is used to display the disk space occupied by mounted file systems? 1.130. What file contains a list of currently mounted file systems? 1.131. On Solaris, what file contains settings that define the default maximum time a password is valid and the default minimum time period before a password must be changed? 1.132. What command and options would you issue to set the permissions on a file to read, write, execute for owner, read and execute for group, and no permissions for other? 1.133. What command will display the default file permissions that will be assigned when a user creates a file? 1.134. What command is used to run an application with a different security context than the user’s default? What is the configuration file for this command, where programs are listed which defined users can execute with higher privileges? 1.135. What file defines the default runlevel of the system and dictates what directory holds the startup scripts for that runlevel? 1.136. What command is used to check a filesystem for errors? 1.137. Why are there normally two bin directories, /bin and /usr/bin? 1.138. On Solaris, what file defines the master kernel configuration file? 1.139. At the Solaris OpenBoot prompt, what command will display all of the SCSI devices connected to the system? 1.140. How do you boot a Solaris system into single user mode? 1.141. What command allows you display and to modify your keyboard mappings in X Windows? 1.142. In Linux, what file contains a list of all IRQs currently in use? 1.143. You attempt to unmount a currently mounted disk and you receive the error “Unable to umount: device or resource busy”. What does this mean and what must you do before you can unmount the disk? 1.144. You need to run the fsck program against a file system, but you must do this while the file system is unmounted. Since the file system in question is the root file system, you cannot unmount it while the system is running. What options do you have for running fsck against this file system? 1.145. You have forgotten root’s password. What options do you have to get back into the system as root? 1.146. Your UNIX workstation is unable to ping any hosts on the local TCP/IP network. What steps do you take to troubleshoot this problem? 1.147. Your production UNIX system has been running fine when users suddenly complain that the system is slow. You log in and the system feels ‘sluggish’ and the terminal is unable to keep up with your typing. What steps do you take to diagnose the problem? 1.148. Describe the steps the system goes through, at boot time, before the users may sign on. 1.149. When, and depending on what, are the other filesystems checked and mounted? 1.150. Name two ways to bring the system down. 1.151. What are the files checked or scripts executed when a user logs in? 1.152. When an account, for various reasons, is not used anymore, how can the system administrator disable it? 1.153. How can a user ensure that certain sensitive files cannot be read by others? 1.154. How can a user remind another user about an important meeting taking place on a certain date, at a certain hour? 1.155. How can a user execute a long command and still have the terminal available for work? 1.156. Once the background command has been started, can it be aborted like any other foreground command? 1.157. What is a filesystem? 1.158. What happens if you have a directory such as /tmp, and you mount a filesystem such as /dev/u, on this directory? 1.159. Can the system administrator enable users to mount a filesystem? 1.160. Does it make sense for a directory to have the execute permission on it? 1.161. By default, the GID (group identifier) of a newly created file is set to the GID of the creating process or user. How can this behavior be changed? 1.162. What is a link between files, and what is the command you would use to link files? 1.163. What are the two types of links? 1.164. Which type of link consumes an inode, and which type does not? 1.165. What is the most common way of locating files? 1.166. How can you search a file for occurrences of a word or phrase? 1.167. How can you list the names of all files in all subdirectories in which there is a certain pattern? 1.168. Assuming you have a big file and you want to clear it (empty it), but you want to keep the file and its permissions, what could you do? 1.169. Assuming that a directory becomes too large (has too many entries) and you decide to make two directories out of it (one of which has the same name), how would you proceed? 1.170. What is the purpose of the lost+found directory in a filesystem? 1.171. List three commands most often used for archive or data transfer between devices. 1.172. Once you obtain a stable system, that is, a good kernel, what are some of the first things the system administrator should do? 1.173. What steps should be followed when you find you have an unusable root filesystem? 1.174. Can you copy files to a DOS floppy on a UNIX system? 1.175. How can you find out the baud rate, the parity scheme, and other information about a serial line? 1.176. How do you set the terminal type? 1.177. What performance tools can you use to diagnose system inefficiency? 1.178. How can the time command be used? 1.179. What is swapping (paging)? 1.180. What should you do in the case of an intense swapping/paging activity? 1.181. How can you check the status of processes? 1.182. How can you stop a runaway process? 1.183. Assuming that you have to start the execution of a long command and you want to log out and go home, how do you go about it? 1.184. How can you prioritize processes? 1.185. How can you schedule programs to run at specific times? 1.186. What is a shell? 1.187. How does the shell execute the commands? 1.188. How does the shell locate commands that the user wishes to execute? 1.189. Which are the characters you could use to form regular expressions to match other characters? 1.190. How can you redirect the output of a command? 1.191. How can a command take the input from a file? 1.192. What is command substitution? 1.193. What are positional parameters (arguments)? 1.194. What is a pipeline for a shell script? 1.195. How can you use parentheses or braces at the command line or in a shell procedure? 1.196. What is the difference between using parentheses and using braces? 1.197. What are functions from the shell’s standpoint? 1.198. What is a command’s environment? 1.199. How can you initialize new variables in a shell script and use them later in the sign-on shell? 1.200. How can you solve the following situation: You want the users, once signed on, to be put in the application program; once they quit the application, you want them signed off the system? 1.201. How can you make sure that the work file created during the execution of a script will be removed even if the script was interrupted? 1.202. Assuming you have to run backups during the night, and there is no night operator and the backup utility prompts you for answers before it starts, how would you solve this problem? 1.203. How can you write the standard output and the standard error for a command to the same file? 1.204. In a command list, how can you arrange the commands, so if one of them fails, the execution of the list stops? 1.205. In a command list, how can you arrange the commands so that, the second one is executed only if the first one fails? 1.206. What can you do to fix the problem if one of your filesystems runs out of inodes? 1.207. How can you check the amount of free space on filesystems? 1.208. What does it mean if a user has write permissions on a directory but is unable to remove files from that directory? 1.209. What command can be used to compare two text files? 1.210. How can you convert a text file from UNIX format to MS-DOS format? 1.211. What is umask? 1.212. How can you find out what variables are currently assigned? 1.213. What command can you use to archive a raw device? 1.214. What are device drivers? 1.215. What are UNIX daemons? 1.216. Assuming you want to start the database engine every time you boot the system, how would you do it? 1.217. When the system is coming down, how would you bring down the database engine? 1.218. What can you do if a scrambled terminal responds to keyboard input but the display is incorrect? 1.219. What can you do if a terminal that responds to keyboard input does not display the characters entered at the keyboard? 1.220. How can all the files ending in “.foo” in a directory be renamed to end in “.bar”? 1.221. Why wouldn’t the administrator be able to unmount a filesystem? 1.222. Which of these shells will natively run Bourne shell scripts? 1.223. What function is used to delete a file within C? 1.224. What is the basic function used to get information about a file (permissions, owner, size, etc.)? 1.225. What function is used to create a named pipe? 1.226. How can a C program set a timer to alert itself after a certain interval has passed? 1.227. How can a C program catch a signal? How can a Bourne shell script catch a signal? 1.228. What information does the size command report about a command object file? 1.229. What is the difference between fork() and vfork()? 1.230. What is a zombie process, and how is it avoided? 1.231. Other than signals, pipes, and files of any sort, what mechanisms are available to UNIX processes that enable them to exchange information? 1.232. What is the difference between fopen() and open()? 1.233. What is mmap(), and why is it better than read() or write()? 1.234. How do I remove a file whose name begins with a “-” ? 1.235. How do I remove a file with funny characters in the filename ? 1.236. How do I get a recursive directory listing? 1.237. How do I get the current directory into my prompt? 1.238. How do I read characters from the terminal in a shell script? 1.239. How do I rename “*.foo” to “*.bar”, or change file names to lowercase? 1.240. How do I {set an environment variable, change directory} inside a program or shell script and have that change affect my current shell? 1.241. How do I redirect stdout and stderr separately in csh? 1.242. How do I tell inside .cshrc if I’m a login shell? 1.243. What’s wrong with having ‘.’ in your $PATH ?
|
||||