Anda di halaman 1dari 4

Part – A

Q1. Design a new panel on GNOME desktop by adding given features:


i) Add a clock, window selector on this panel
ii) Change the background of panel and its font
iii) Create a launcher for GNOME editor.

Ans: The following are the steps to be followed:

(i) To add a Panel

(a) Right click on the panel.


(b) Click on Add a Panel option.
(c) The new panel will be added.

(ii) To Add a clock and windows selector

(a) Right click on the Panel.


(b) Click on Add to Panel.
(c) Click on Clock to add clock and windows selector to add it.
(d) The Clock and windows selector will be added.

(iii) To change the background of the panel

(a) Right click on the Panel.


(b) And Click on Properties
(c) In the general tab change the size and in the background tab change
the background.
(d) The changes will be saved.

(iv) To create a launcher for the desktop

(a) Right click on the workspace (desktop).


(b) Click on Add Launcher option.
(c) Follow the instructions like adding the application and setting the file
name.
(d) Launcher will be created.

Q2. a) Suppose you want to make your system dual bootable in Linux, which
boot loader will you prefer and why?
b) Which one is better, installing windows over Linux or installing Linux over
windows? Find out the possible errors for both the scenarios.

Ans (a) The GRUB boot loader is preferred over LILO for dual bootable and the
following are the advantages which make GRUB better one:

(i) GRUB comes with Windows, Mac, DOS, Linux OS and it has much more
functions like altering entities while booting whereas LILO comes only with
Linux.

(ii) GRUB has a more powerful, interactive command line interface. LILO, on the
other hand, only allows one command with arguments.
(iii) LILO stores information about the location of the kernel or other operating
system on the Master Boot Record (MBR). Every time a new operating system
or kernel is added to the system, the Stage 1 LILO bootloader has to be
manually overwritten, otherwise there is no way to boot the new OS or kernel.
This method is more risky than the method used by GRUB because a mis-
configured LILO configuration file may leave the system unbootable (a popular
way to fix this problem is to boot from Knoppix or another live CD, chroot into
the partition with mis-configured lilo.conf and correct the problem). On the
other hand, correcting a mis-configured GRUB is comparatively simple as
GRUB will default to its command line interface where the user can boot the
system manually. This flexibility is probably the main reason why many users
nowadays prefer GRUB over LILO.

(b) Installing Linux over windows is better and always preferred over installing windows
over Linux. Initially when Linux was launched it was more with command like interface
and there was no graphical interface with it, so it was mostly used by developers and
engineers. Whereas Windows from the beginning is coming with graphical interface so it
is much more interesting and user friendly and that is the reason that by default with all
the new computers we have Windows as an OS and not Linux.
The biggest errors which are being faced by installing any OS (Linux) over a previous
version (windows) are driver compatibility. The drivers working with windows might not
work with Linux and the software installed might not work and one needs get the update
version of it.

Q3. Give command to perform the following:


a. Create a directory tree under Home directory
b. Display current working directory.
c. Display the name of user's Home directory using environment
variables
d. Allow all group users to modify the contents of ABC.txt file
e. Revoke read execution rights from all users on ABC program

Ans.The following are the commands to be followed while performing the following tasks

(a) To create a directory tree under home directory

(i) $/home/ mkdir officedata


(ii) $/home/ cd officedata
(iii) $/home/officedata/ mkdir employees
(iv) $/home/officedata/ mkdir staff

(b) Display the current working directory

(i) pwd

(c) Display the name of user's Home directory using environment variables

(i) $HOME

(d) Allow all group users to modify the contents of ABC.txt file

(i) chmod 060 ABC.txt

(e) Revoke read execution rights from all users on ABC program.

(i) chmod 000 ABC


Part – B

Q4. Write all the steps to write, compile and execute a shell script in Linux
environment using a program to find largest of 3 numbers.

Ans The following is the program for the above query

echo Enter three number


read a b c
if test $a –gt $b –a $a –gt $c
then
echo a is the greatest number
elif test $b –gt $a –a $b –gt $c
then
echo b is the greatest number
elif test $c –gt $a –a $c –gt $b
then
echo c is the greatest number
else
echo Not a valid entry
fi

Q5.
a) Write down the syntax to change the command line prompt in shell from $
to %
b) Write down the syntax to create a shell variable of your own.

Ans (a) PS1=%

(b) code=/home/manyagarg
Cd $code

Q6. a) Write the shell command to create a user with name student whose
primary group is college, set its expiry date to 18 Oct, 2010 and make him a
part of additional groups study, research.
b) Write the shell command to change the group name from staff to teaching.

Ans
(a) useradd –g college –G study –G research –e 2010/10/18 student
(b) groupmod –n teaching staff

Q7. If a 5 digit number is input through keyboard, write a shell script to


calculate the sum of its digits.

Ans: The shell script code for the program is like this :-

echo Enter any 5 digit number


read num
while [ num –ne 0 ]
do
n= `expr $num % 10`
num= `expr $num / 10`
sum= `expr $sum + $n`
done
echo The sum of the digits
echo $sum

Anda mungkin juga menyukai