Linux/Unix Systems Exam - CP 211

THE UNIVERSITY OF DODOMA
COLLEGE OF INFORMATICS AND VIRTUAL EDUCATION
SCHOOL OF INFORMATICS

UNDERGRADUATE UNIVERSITY EXAMINATIONS
FIRST SEMESTER 2017/2018

CS 214: Linux/Unix System Administration and Management

Date: 27th February, 2018
Duration: 3 Hours


Instructions:

  1. This paper consists of six questions each carrying 20 marks.
  2. Answer all questions from section “A” and any two from section “B”.
  3. Whenever possible use examples or diagrams to illustrate your idea.
  4. All University of Dodoma Examinations Regulations Apply.

SECTION A (60 Marks)

Question One

(a) Write short notes on the following: (2 Marks Each)

i. chmod command
ii. umask command
iii. nice and renice command
iv. wall command
v. diff and comp command
vi. df command

(b) Differentiate the following terms: (2 Marks Each)

i. UID and EUID
ii. chgrp and chown
iii. etc/passwd and etc/group
iv. internal and external command


Question Two

(a) Describe package management in linux using yum.
(b) Write a command to convert text in file1 from lowercase to upper case and redirect its output to file2.
(c) Write the steps involved when formatting flash drive with FAT 32 file system on command prompt.
(d) Explain the difference between UNIX and LINUX.


Question Three

(a) Explain “user management commands”; describe the files associated with these commands. (10 Marks)

(b) After the user “User1” left the company, the command “userdel User1” was issued. This deleted the user “User1”. Although this entry was deleted “in /etc/passwd” file it still exist in “/home/User1”.

i. Explain why? (2 Marks)
ii. As an administrator, in place of the command “userdel user1” Identify what would be the appropriate solution. (2 Marks)

(c) Your company has implemented a policy that user password must: (6 Marks)

i. Have at least 9 characters
ii. User should change password after first login
iii. Require changing the password after 15 days since last password change
iv. Require at least 7 days between password change
v. Start warning the user 2 days before password expiration

Write a shell script to implement the above given policy.


SECTION B (40 Marks)

Question Four

(a) What is file system? (2 Marks)
(b) Explain the EXT file system structure. (8 Marks)
(c) You have been asked to setup LVM volume for the Linux group. Your task is to use “/dev/sdb” to create logical volume named “linux_lvm”, format it with xfs, and mount under “/linux”. Make sure the Linux group owns “/linux” and the volume is mounted in “/etc/fstab” using UUID. List detailed steps and commands to accomplish the above task. (5 Marks)
(d) From the scenario in c) above write commands to: (1 Mark Each)

i. Reduce the size of logical volume and file system by 1GB
ii. Run the file system check
iii. Check file system current size and usage
iv. Deactivate the volume group
v. Remove PV from VG


Question Five (10 Marks Each)

(a) Explain the booting and shutting down mechanism for a linux system.
(b) Write a script that determines which 10 home directories are the largest on the system. Schedule the script to run every Monday night at 12:00 a.m and have it mail its output to your email “linux.cive@udom.ac.tz”.


Question Six

(a) Explain in detail the dd command uses in the linux system. (10 Marks)
(b) Write commands to: (1 Mark Each)

i. Find all files which have been accessed within the last 30 days
ii. Display disk usage in kilobytes
iii. List the files in current directory including hidden files, and sort them by size

(c) Explain the output of the commands in “i” through “vii” when issued: (1 Marks Each)

i. (date; ps —ef | awk '{print $1}' | sort | uniq | wc –1 ) >> activity.log
ii. tar – cC /old . | tar – xC /new
iii. awk –F : '$3 == 0 {print $0}' /etc/passwd
iv. tee -a Linux.script
v. mount -t cifs – o username=Linux //Linux/myshare /myshare
vi. ls –l 2> /dev/null
vii. When **Linux :: 44:** David, Wilson, Iddy is added to /etc/group


END OF EXAMINATION PAPER