A8-R4: BASICS OF OS, UNIX & SHELL PROGRAMMING
(Answer all the questions)
1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)1.1 What does the following command do?
who | wc –l
A) List the number of users logged in
B) List the users
C) List the number of users in the system
D) Display the content of who command
1.2 What is the default number of files open per user process?
1.3 $ oneko &
What is the meaning of above command?
A) run "oneko" in background
B) run "oneko" in foreground
C) stop "oneko"
D) Above command is wrong
1.4 What is a context switch?
A) Kernel switches from executing one process to another.
B) Process switches from kernel mode to user mode.
C) Process switches from user mode to kernel mode.
D) None of the above
1.5 Which command is used to set limits on file size?
1.6 Which among the following interacts directly with system hardware?
1.7 Which command is used to show process hierarchy in tree format?
A) ps –tree
C) ps –t
D) none of the above
1.8 What is the purpose of id command?
A) Print effective and real UID
B) Print effective and real GID
C) Print effective and real UID and GID
D) None of the above
1.9 Which of the following command return the exit status of last command?
1.10 Which command is used to print the current working directory?
B) echo $PWD
C) Both A) and B)
D) None of the above
2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)2.1 vi editor commands are not case sensitive.
2.2 The soft link will increase the link counter of the file.
2.3 The encrypted password of a user is stored in /etc/shadow.
2.4 The file /proc/modules is a text list of modules that have been loaded by the system.
2.5 Parent process id of a daemon process is 1.
2.6 ‘echo $LOGIN’ command is used to print the login shell of a user.
2.7 Applications communicate with kernel by using System Calls.
2.8 Each process has unique inode table.
2.9 Hidden files are those whose ‘read’ bit is set to ‘h’.
2.10 Auto-indentation can be set using the command ‘:set ai’.
3. Match words and phrases in column X with the closest related meaning/word(s)/phrase(s) in column Y. Enter your selection in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)
3.1 Command to get the kernel version in Linux A. export
3.2 Any file’s attribute information is stored in B. getppid()
which structure on the disk
3.3 Which file is read by init to get the default runlevel C. Block special file
3.4 Binary or executable files D. Import
3.5 read() system call on success returns E. Inode
3.6 CD-ROM F. Uname -r
3.7 Get parent process identification number G. /etc/inittab
3.8 UNIX/Linux kernel H. getpid()
3.9 Command to create environment variable I. wc
3.10 Command to count number of character in a file J. number of characters
K. Regular file
4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)
A. Quick boot B. du C. read
D. init E. Kernel F. /dev
G. device files H. Super Block I. write
J. touch K. Cold boot L. /proc/[PID]/stat
4.1 The file system information is stored in ________.
4.2 Proc filesystem does not contain ________.
4.3 “ps” command uses the file ________ to provide the information.
4.4 Bootstrapping is also known as ________.
4.5 ________ command is used to display disk consumption of a specific directory.
4.6 ________ command creates an empty file if file does not exist.
4.7 printf() uses ________ system call.
4.8 ________ is loaded into memory when system is booted.
4.9 At the end of kernel bootstrap, ________ process is started.
4.10 All device files are stored in ________ directory
(Answer any FOUR questions)5.
a) Write a shell program to find out total number of such files inside the present directory whose
size is greater than or equal to 500 Bytes.
b) Write a shell program which will compare contents of two files; If the content of those files are
same, it will remove the second file else it will concatenate the content of both files and will save
under the first file. The names of the files should be supplied through command line and the
program should check existence of the file and should continue if and only if both the files exist.
a) Explain difference between filters and commands.
b) How the external and internal commands are different in UNIX?
c) What is permission mode of a file? Explain with example.
d) How the permission mode can be changed? Give example.
a) What are the different modes of vi editor?
b) What do you mean by Environment Variable in Linux?
c) How can you permanently delete first 2 lines of a file?
d) What is symbolic link? Explain with example.
a) Which system call is used to create a child process? Explain with example.
b) How one process sends signal to another process?
c) What is Zombie process and what is Orphan process?
d) How we can list all Zombie processes present in a system?
a) What is X Windows?
b) When we are compelled to use rcp in preference to ftp?
c) Differentiate between MAC address and IP address.
d) What are the different classes of IP addresses?