0% found this document useful (0 votes)
5 views4 pages

Unix Shell

The document outlines a course on Unix and Shell Programming for BCA students, focusing on the Unix operating system, command-line interface, and shell scripting. It details course objectives, outcomes, a comprehensive syllabus covering various Unix commands and programming techniques, and practical lab exercises. Additionally, it includes suggested readings to enhance students' understanding of the subject matter.

Uploaded by

rakeshpersonal78
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

Unix Shell

The document outlines a course on Unix and Shell Programming for BCA students, focusing on the Unix operating system, command-line interface, and shell scripting. It details course objectives, outcomes, a comprehensive syllabus covering various Unix commands and programming techniques, and practical lab exercises. Additionally, it includes suggested readings to enhance students' understanding of the subject matter.

Uploaded by

rakeshpersonal78
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

 S.

Vijayalakshmi, Hibernate: Java Persistence Framework, Pearson Education India, 1st


Edition
 K. M. S. R. Anjaneyulu, Java Hibernate, Laxmi Publications, 1st Edition

SUBJECT NAME: Unix and Shell Programming Credit: 5 (3L +2P)


SUBJECT CODE: BCAC602

COURSE OBJECTIVE:

The Unix and Shell Programming course is designed to provide BCA students with a thorough
understanding of the Unix operating system and its powerful command-line interface. This course
emphasizes the foundational concepts of Unix, including file system structure, process
management, and inter-process communication, while focusing on shell scripting for automation
and system management.
Students will explore the Unix environment, learning to navigate the file system, manipulate files,
and manage processes efficiently. The course also introduces shell programming using popular
Unix shells such as Bourne Shell, C Shell, and Korn Shell. Through scripting, students will develop
the ability to automate repetitive tasks, schedule jobs, and manage system configurations.
By the end of the course, students will be well-equipped with the knowledge and skills to work in
Unix-based environments, enabling them to pursue careers in system administration, software
development, and IT support. The course fosters problem-solving abilities and a strong command
over Unix tools and scripting techniques.

Course Outcome

Demonstrate proficiency in using Unix commands to navigate the file system, manage
CO1 files, and control processes.
Develop shell scripts to automate repetitive tasks, schedule jobs, and manage system
CO2 configurations effectively.
Utilize Unix utilities such as grep, awk, and sed for file processing, text manipulation, and
CO3 data extraction.

Implement inter-process communication and manage process control to optimize system


CO4 performance and resource usage.

Apply knowledge of Unix tools and shell programming to solve real-world problems in
C05 system administration and IT operations.
DETAILED SYLLABUS:

Modu Topics Covered Hours Marks


le
M1 Introduction to Unix; Discuss about POSIX; Discuss 2 5
about Linux and most popular distributions of Linux;
Compare Between the Unix and Linux; Unix system
Architecture; Discuss about the Unix kernel and system
call interface; Unix directory structure;
M2 Unix File commands: create directory, change directory, 8 12
move and copy directory, create file, remove file;
remove directory, listing directory information; discuss
about the types of files; change file security; creating
the empty file and change the timestamp; discuss the
access time, modification time and change time; touch
with d and t option; finding the files and directorires;
soft link and hard [Link] about i node; size of file
[Link] of > and >>, Use of pipe and tee command.
M3 row eise and column wiseselection from the file with 7 14
different options, merge lines of files horizontally with
different options; split large files into smaller files,
counting number of lines, words , characters; sorting the
content of the file according to the specific column,
numerical sorting, comparing two files line by line,
compare two files character by
character, compare two sorted files., join the two files,
the uniq command, the transformation command.
M4 Utility command: cal, date, pr, who, bc, echo, zip unzip 2
, gzip commands, Archiving the file
M5 Vi editor: Overview of VI Editor as a text editor in 2 5
Unix/Linux; Basic mode operations in VI (Command
mode, Insert mode, and Last-line mode).
Basic Operations in VI Editor (Starting VI: Opening and
editing files using vi filename, Navigation: Moving the
cursor (h, j, k, l, arrow keys, etc.), Moving by word, line,
or page.
Text Editing (Inserting text in insert mode (i, I, a, A, o,
O), Deleting text (x, dd, dw, D, etc.), Copying and
pasting (yy, pp, p, P), Undo and redo changes (u,
Ctrl+r).).
Working with Files (Saving and Exiting (Saving files:
:w, :w filename), Exiting: :q, :q! (force quit without
saving), Saving and quitting together: :wq, ZZ.).
File Operations (Opening a new file: :e filename.)
Search and Replace (Searching forward and backward,
using regular expressions for searching.)
Replace (Replacing text using :s/old/new/g., Global
search and replace in a file.)
M6 Searching the file with pattern using grep and awk 8 15
command, Advance searching the file with grep, awk
command with print and printf, awk with comparison
operator, arithmetic operator, begin and else
section,Begin and end section, if else statement, built in
variable fs and ofs, awk with string and arithmetic
functions, use of loops, Use of searching and substitute
function.
M7 Process in Unix, Discuss the process command with 8 9
different options, Discuss about the init process and unis
login process, discuss briefly the fork() , getpid(),
getppid(), wait(0, zombie process, , pipe() and
message(), Discuss unix process states and the diagram,
Discuss about the scheduler used in unix, swapped
memory, discuu about the vmstat and top command,
discussion about the nice command
M8 Shell programming: Introduction of shell and types of 8 10
shell, use of shell, system variables and user defined
varible, use of single and double quote and backslash,
command substitution, let: assigning and evaluationg the
expression, take input from the user, Command line
parameters, use of if statement, use of for, while and
until loop, Observe the exit status.
INTERNAL EXAMINATION 3 30
TOTAL 48 100
Practical:
SUBJECT NAME: Unix and Shell Programming Lab Credit: 2
SUBJECT CODE: BCAC692

The practical sessions shall, with due diligence, reflect and reinforce the theoretical syllabus, and
shall moreover include the undertaking of a modest yet purposeful project, designed to furnish the
student with a sound comprehension of foundational principles, and to cultivate the capacity to
apply such learning to the resolution of real-world exigencies.

List of Sample question for Unix and shell programming Lab:

Direct Lab Questions


1. Basic Unix Commands
List all files in a directory along with their permissions and ownership.
Display the top 10 largest files in a directory using du and sort.
Find and replace a specific word in a file using sed.
2. File and Directory Management
Write a shell script to create a directory structure for a project (e.g.,
Project/Docs, Project/Src, Project/Bin) and verify the structure.
Create a script to back up all .txt files in the current directory into a new
directory named Backup_<date>.
3. Process Management
Write a script to list all processes owned by the current user.
Create a script to monitor CPU usage and alert the user if it exceeds a specific
threshold.
4. Text Processing
Use awk to extract and display the second and fourth columns from a CSV file.
Use grep to find all lines in a file that contain a specific pattern and count the
occurrences.
5. Shell Scripting Basics
Write a shell script to calculate the factorial of a number entered by the user.
Create a script to check if a given file exists and whether it is readable, writable,
or executable.

Case Study-Based Lab Questions


System Monitoring Tool
Scenario:
Build a shell script-based tool to monitor and report system performance, including disk usage,
memory usage, and active processes.
Lab Questions:
1. Write a script to display the following system details:
Total and free memory.
Disk usage percentage of each mounted partition.
Number of active processes.
2. Implement a feature to save the report to a file with a timestamp in the filename (e.g.,
System_Report_<date>.txt).
3. Extend the script to alert the user if disk usage exceeds 80% or memory usage goes below
10%.

SUGGESTED READING:

 Yashavant Kanetkar, Unix Shell Programming, BPB Publications, 1st Edition


 Operating System and Unix, S. Gayathri; S. Priyadharshini; N. S. Usha, Khanna
Publishing House
 Sumitabha Das, UNIX: Concepts and Applications, Tata McGraw-Hill Education, 4th
Edition
 Vikas Chawla, Unix and Shell Programming, Oxford University Press, 1st Edition
 M. G. Venkatesh, Advanced Unix Programming, Wiley India, 1st Edition
 Stephen G. Kochan, Unix Shell Programming, Pearson Education India, 2nd Edition
 S. R. Rajesh, UNIX Shell Programming, Pearson Education India, 1st Edition
 Brian W. Kernighan, The UNIX Programming Environment, Prentice Hall, 1st
Edition

You might also like