You are on page 1of 2

Kuvempu University

Assignment 1 for B.Sc. (IT) & M.Sc. (IT) Courses


(Academic Year 2005 - II Cycle)

Subject: UNIX & Shell Programming


Subject Code: BSIT - 43

Assignment: TA (Compulsory)

1. Why is UNIX more portable than other operating systems?

In UNIX the application uses UNIX interface to manage the hardware needs. It has
function that manage the hardware and the functions that manage executing
applications. UNIX’s layered architecture insulates the application from the different
type of hardware. This allows the software developer to support the single application
on multiple hardware platforms with minimal effort and due to this factor UNIX is more
portable than any other O/S.

2. Explain briefly the significance of a UNIX file system.

In the UNIX file system each hardware device is viewed as file and is called as device
file. This allows the same simple method of reading and writing files to be used to
access to each hardware device. The file system manages read and write access to
user data and devices such as printer attached to the system. It implements security
controls to protect the safety and privacy of the information. Because of this type of
operation the UNIX applications are also portable across various platforms.

3. Distinguish between internal and external commands with examples.

The commands that are built into the Shell are called internal commands. For
example the ‘cd’ command is built – in. The Shell command interprets the command
and changes the current directory.

Commands that stored in the external directory, such as the ‘cat’ command which is an
external program stored in the file/bin/cat, are called external commands.

The Shell doesn’t start a separate process to run internal commands; hence it is faster
than external commands. External commands require the Shell to run a new sub-
process; which takes time especially if the system is busy.

4. Explain the output of the ls –l command.

Is – I command gives the output of a detailed list of the files in current directory. It gives
a view of basic information about files and directories.
Ex.

$ Is – I
Arith.1st
Exp.1st
Exp.1st
Sqlscripts

© NIIT Page 1 of 2
5. Write a UNIX command to display the current date in the form of dd/mm/yyyy.

$date+”%d%h%y” = Command for displaying the current date in the form of


dd/mm/yyyy.

6. Explain the different types of files in UNIX.

There are four different types of file in UNIX that shows as given below:

1. Ordinary Files: Ordinary files can contain text, data or program information. It
cannot contain another file or directory. It can be a text file or a binary file. A text file
contains lines of printable characters where every line is terminated with a new line
character. A binary file can contain any of the ASCII characters. Most of the UNIX
commands are binary files.

2. Directory Files: Directories are containers that can hold files and other directories.
A directory is actually implemented as a file that has one line for each item contained
within the directory. Each line in the directory file contains only the name of the item
and a numerical reference to the location of the item.

3. Special Files: It represents I/O devices like a terminal, a disk drive or a printer.
Because UNIX treats such devices as files some of the commands used to access
ordinary files will also work with device files. This allows more efficient use of software.
Special files can be either character special files that deal with streams of characters or
block special files that operate on larger blocks of data. Typical block sizes are 512
bytes, 1024 bytes and2048 bytes.

4. Links: A link is a pointer to another file. Since a directory is list of the names and i –
numbers of files, a directory entry can be a hard link, in which the i – number points to
directly to another file. A hard link to a file cannot be distinguished from the file itself.
When a hard link is made then the i – numbers of two different directory file entries
point to the node. Hence hard links cannot span across file systems. A soft link
provides an indirect pointer to a file. A soft link is implemented as a directory file entry
containing a pathname. Soft links are distinguishable from files and can span across
file systems.

7. Reduce the number of keystrokes to execute this command:


tar –t –v –f /dev/fd0

With the help of this command we make one archive file where we use compressed
function for reduce the number of keystorkes.
czf myarchive dir.

Assignment: TB (Compulsory)

1. Write a UNIX command to count how many users have logged on to the UNIX
system.

$ who – q

© NIIT Page 2 of 2

You might also like