Professional Documents
Culture Documents
PRACTICAL FILE
Subject:- OS AND LINUX
Subject Code:- BCA 371
1
TABLE OF CONTENT
3 To understand basic directory navigation commands like cat,cd, mv, cp, rm, mkdir,rmdir 8-11
,file, pwd command.
4 To understand basic commands like:- 12-13
date,cal,echo,bc,ls,who,whoami,hostname,uname,tty,aliase
5 To understand vi basics, Three modes of vi Editor, how to write, save, execute a shell 14
script in vi editor.
6 To understand process related commands like: -ps, top, pstree, nice, renice in Linux. 15-16
11 Write basic shell script to input the month number and generate corresponding 21
calendar.
12 Write basic shell script to list all directories 22
13 Write basic shell script to display greatest of three numbers. 23
14 Write basic shell script to check whether the number entered by user is prime or not 24
15 Set a file to be read-only with the chmod command. Interpret the file permissions 25
displayed by the ls -l command.
2
Practical 1: Connect to the Linux Server and understand the basic Directory Structure of Linux.
1. /bin directory
Output:
2. /boot directory
Output:
3. /dev directory
Output:
4. /etc directory:
Output:
3
5. /home directory
Output:
Output:
4
Practical 2. To understand help commands like:-man,info,help,whatis,apropos
1. Man
Command:
Output:
2. Info
Command:
Output:
3. help
5
Command:
Output:
4. whatis
Command:
Output:
6
5. apropos
Command:
Output:
7
Practical 3. To understand basic directory navigation commands like cat,cd, mv, cp, rm, mkdir,rmdir ,file,
pwd command.
1. Cat
Text-file-example.txt:
Command:
Output:
2. Cd
Output:
8
3. Mv
Output:
4. cp
Output:
5. rm
Output:
9
6. mkdir
Output:
7. rmdir
Output:
8. file
Output:
10
9. pwd
Output:
11
Practical 4. To understand basic commands like:- date,cal,echo,bc,ls,who,whoami,hostname,uname,tty,aliase
1. date
Output:
2. cal
Output:
3. echo
Output:
4. Is
Output:
5. who
12
Output:
6. whoami
Output:
7. hostname
Output:
8. uname
Output:
9. tty
Output:
10. aliase
Output:
13
Practical 5. To understand vi basics, Three modes of vi Editor, how to write, save, execute a shell script in vi
editor.
1. Write
Output:
2. Excute
Output:
3. Save
Output:
14
Practical 6. To understand process related commands like: -ps, top, pstree, nice, renice in Linux.
1. Ps
Output:
2. Top
Output:
3. Pstree
Output:
15
4. Nice
Output:
5. Renice
Output:
16
Practical 7. To understand how to examine and change File permissions.
17
Practical 8. Write basic shell script to display the table of a number
Output:
18
Practical 9. Write basic shell script to input a character from user and then check whether it is uppercase,
lowercase or digit
Output:
Input: “A”
Input “b”
Input: “7”
19
Practical 10. Write basic shell script to calculate factorial of a number.
Output:
20
Practical 11. Write basic shell script to input the month number and generate corresponding calendar.
Output:
21
Practical 12. Write basic shell script to list all directories.
Output:
22
Practical 13. Write basic shell script to display greatest of three numbers
Output:
23
Practical 14. Write basic shell script to check whether the number entered by user is prime or not.
Output:
24
Practical 15. Set a file to be read-only with the chmod command. Interpret the file permissions displayed by
the ls -l command.
Chmod command:
Is- command:
25