0% found this document useful (0 votes)
57 views7 pages

Tools and Application Shell Kernel Hardware

This document provides information about various Unix/Linux concepts including what a shell, kernel, and process are. It also discusses the minimum hardware requirements for installing Unix, the Unix file system, basic Unix commands like ls and cp, and features of the Unix operating system. Additionally, it covers shell scripts for tasks like checking if a number is positive/negative/zero, comparing two numbers, finding the sum of even/odd numbers, and printing a name multiple times. The document contains questions and explanations related to Unix/Linux systems.

Uploaded by

Aakash Bhoite
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views7 pages

Tools and Application Shell Kernel Hardware

This document provides information about various Unix/Linux concepts including what a shell, kernel, and process are. It also discusses the minimum hardware requirements for installing Unix, the Unix file system, basic Unix commands like ls and cp, and features of the Unix operating system. Additionally, it covers shell scripts for tasks like checking if a number is positive/negative/zero, comparing two numbers, finding the sum of even/odd numbers, and printing a name multiple times. The document contains questions and explanations related to Unix/Linux systems.

Uploaded by

Aakash Bhoite
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

1. What is Shell?

SHELL or command interpreter is a mediator which interprets the command given by us then
conveys them to kernel which in turn executes them.
2. What is Kernel?
It is the heart of unix operating system. , which is an interface between shell and hardware.
3. What is Process? Explain in brief.
Any file under execution is called a process.
4. What is Operating System?
An os is a software which manages the computers hardware and provides safe environment
for running the programs.it acts as an interface between the user and the hardware.
It is loaded into the memory when computer is booted and is active till the machine is on
5. Write a short note on History of Unix
6. What are the minimum hardware requirements for installing Unix?
80 mb harddisk,4 mb ram , 16 –bit processor (80286,80386,80486) we connect the terminal
with host with 4/6/8 port controller card , which is installed on the expansion slot on the
motherboard of host m/c.
One end is connected with controller card of host m/c and other end with the serial
port of the terminal.. any dos based m/c with a serial port can act as terminal..
Out 80 mb of harddisk space 40 mbis covered by unix files and 20 mb is
used by swap files . the swap space is used when unix falls short of memory at such times
stores data temporarily o swap file .
7. Write a short note on unix file system
8. Explain the command which is used to list the all files in current directory.
Ls -l
9. Explain the features of Unix operating system.
10. Write a short note on the Different Security mechanisms available in Unix.
11. What is Terminal? Explain different types of terminals.
12. Write a short note on Unix System Organization / Unix Architecture
Unix is divided in 3 levels . the outer level consist of the application programs and the
utilities, which speak our language.
At the heart of unix is the kernel , which interact with the
hardware in m/c language.
Now the kernel and application are commununicated with each other by a shell

TOOLS AND APPLICATION


Shell
kernel
hardware

The shell or command interpreter is a mediator which interprets the command given by us to
the kernel which in turn executes it. The kernel has various functions like managing file,
memory, carrying data transfer between file and hardware.
Here the main idea is division of labour between two agencies i.e the kernel
an shell.
The kernel interacts with m/c’s hardware . the shell interacts with user.
13. Explain different types of shell.
14. Write a short note on unix file system.
15. Explain following commands in brief :
Mkdir,rmdir,cd,ls,cat,rm,cp,mv,wc,|
(pipe),pg,more,head,tail,echo,expr,read,file,spell,uname,tty,tput,type,path , cut ,
paste , sort , tr , grep , uniq , chmod , uname , logname , id , who , date , cal , bc.
16. Explain if statement with example.
17. Compare for loop with while loop.

SHELL SCRIPTS
1. Write a shell script to check the number is positive or negative or zero. The number must be
taken from the user at run time.
2. Write a shell script to find the greater number from the entered two numbers. Also check
whether that two numbers are equal or not. Numbers must be taken from the user at run
time.
3. Write a shell script to find the sum of n even numbers.

4. echo -n "Enter first number : "

5. read n1

6.  

7. echo -n "Enter second number : "

8. read n2

9.  

10. if [ $n2 -gt $n1 ];

11. then

12. for(( i=$n1; i<=$n2; i++ ))

13. do

14. # see if it is odd or even number

15. test=$(( $i % 2 ))

16. if [ $test -ne 0 ];

17. then

18. echo $i

19. fi

20. done

21. else

22. echo "$n2 must be greater than $n1, try again..."

23. fi

echo”entr no”
read n
i=1
sum=0
while test $i –eq $n
do
while test $i%2 –eq 0
do
echo $i

i=`expr $i+1`
done
sum=`expr $sum +$i;
ech $sum
done

24. Write a shell script to find the sum of n odd numbers.


25. Write a shell script to print your name for 4 times.
For n is 1 2 3 4
Do
Echo “ aakash”
done

26. Write a shell script to print your name for n times.


Echo “ entr the no “
Read n
I=1
While test $1 –le $n
Echo”aakash”
I=`expr $i+1`
done
27. Write a shell script to print the multiplication table of any given number.

Echo ”enter no”


Read n
For i 12345678910
Do
Echo $n* $i =$n*$i
done
28. Write a shell script which reads user name & report whether the user is currently logged in or
not?
29. Echo” ente usrname”
Read uname

For i in who | tr ‘/t’ ‘ ‘ | cut –d ‘ ‘ -f1


Do
If test $uname –eq $i
Then

F=1
fi
done
if test $f=1
then
Echo “ is logged in “
Else
then
“not log”
fi
30. Write a shell script to print the sum of size of all files in current directory.
Create a file item.txt(ITEMNO, ITEMNAME, PURCHASEDT, ITMFORDEPT, USEDBY) with following
records:
01,MOUSE,01-01-96,IT,Raj
02,Rubber,01-03-91,Inventory,Jay
03,Notebook,09-02-97,Production,Keya
04,Paper,10-02-11,Sales,Jay
05,Pencil,12-11-09,IT,Jay
Write a shell script to show all records of item.txt. It also must print the total number of lines,
words and character of the file item.txt.
Write a shell script to search the record who is Jay in item.txt.
Write a shell script to display the name of the person for whom only one item is belonged to.
Write a shell script which will create a new file which contains only item no and item name from
item.txt. Name that new file as itm1.txt. Now perform the following tasks on the file itm1.txt.
1) Replace ‘a’ with ‘A’ and save the output in itm2.txt
2) Display only characters exists in file itm1.txt and save them in itm3.txt.

q) prog to find fact of no ?

echo Enter any number

read num

i=1

fact=1

while [$i -le $num]

do

fact=’echo $fact \* $i | bc‘

i=’expr $i+1‘
done

echo factorial value of $num = $fact

# Shell program to find sum of odd numbers in a series of 10 numbers


sum=0
i=0
while [ $i -ne 10 ]
do
echo "Enter Number"
read num
if [ `expr $num % 2` -ne 0 ]
then
sum=`expr $sum + $num`
fi
i=`expr $i + 1`
done
echo Sum of odd numbers = $sum
Output
————-
Enter Number
1
Enter Number
2
Enter Number
3
Enter Number
4
Enter Number
6
Enter Number
8
Enter Number
3
Enter Number
1
Enter Number
1
Enter Number
1
Sum of odd numbers = 10

# Program to find sum of digits of a number


echo “Enter Number”
read num
sum=0
while [ $num -ne 0 ]
do
sum=`expr $sum + $num % 10`
num=`expr $num / 10`
done
echo Sum of Digits = $sum
# Output
# Enter Number
# 234
# Sum of Digits = 9
# Enter Number
# 23
# Sum of Digits = 5

# Shell program to reverse a given number


echo "Enter Number"
read num
num2=0
while [ $num -ne 0 ]
do
num2=`expr $num % 10 + $num2 \* 10`
num=`expr $num / 10`
done
echo $num2
Output
————
Enter Number
1234
4321
Enter Number
32453
35423

You might also like