BCS515C Unix System Programming

BCS515C Unix System Programming

Course Learning Objectives

● To help the students to understand effective use of Unix concepts, commands and terminology. Identify, access, and evaluate UNIX file system
● Explain the fundamental design of the unix operating system
● Familiarize with the systems calls provided in the unix environment
● Design and build an application/service over the unix operating system

SYLLABUS COPY

MODULE - 1

Introduction

Unix Components/Architecture. Features of Unix. The UNIX Environment and UNIX Structure, Posix and Single Unix specification. General features of Unix commands/ command structure. Command arguments and options. Basic Unix commands such as echo, printf, ls, who, date, passwd, cal, Combining commands. Meaning of Internal and external commands. The type command: knowing the type of a command and locating it. The root login. Becoming the super user: su command.

Unix files

Naming files. Basic file types/categories. Organization of files. Hidden files. Standard directories. Parent-child relationship. The home directory and the HOME variable. Reaching required files- the PATH variable, manipulating the PATH, Relative and absolute pathnames. Directory commands – pwd, cd, mkdir, rmdir commands. The dot (.) and double dots (..) notations to represent present and parent directories and their usage in relative path names. File related commands – cat, mv, rm, cp, wc and od commands

MODULE - 2

File attributes and permissions

The ls command with options. Changing file permissions: the relative and absolute permissions changing methods. Recursively changing file permissions. Directory permissions. 

The shells interpretive cycle

Wild cards. Removing the special meanings of wild cards. Three standard files and redirection. 

Connecting commands

Pipe. Basic and Extended regular expressions. The grep, egrep. Typical examples involving different regular expressions. 

Shell programming

Ordinary and environment variables. The. profile. Read and read-only commands. Command line arguments. exit and exit status of a command. Logical operators for conditional execution. The test command and its shortcut. The if, while, for and case control statements. The set and shift commands and handling positional parameters. The here (<<) document and trap command. Simple shell program examples.

MODULE - 3

Unix Standardization and Implementations

Introduction, Unix Standardization, UNIX System Implementation. 

File I/O

Introduction, File Description, open, create, read, write, close, fcntl functions.

Files and Dictionaries

mkdir and rmdir functions, reading dictionaries, chdir, fchdir and getcwd functions. Device Special files

The Environment of a UNIX Process

Introduction, main function, Process Termination, Command-Line Arguments, Environment List, Memory Layout of a C Program, Shared Libraries, Memory Allocation, Environment Variables, setjmp and longjmp Functions, getrlimit, setrlimit Functions.

MODULE - 4

Process Control

Introduction, Process Identifiers, fork, vfork, exit, wait, waitpid, wait3, wait4 Functions, Race Conditions, exec Functions. 

Overview of IPC Methods

Pipes, popen, pclose Functions, Coprocesses, FIFOs, System V IPC, Message Queues, Semaphores. 

Shared Memory

Client-Server Properties, Passing File Descriptors, An Open Server-Version 1.

MODULE - 5

Signals and Daemon Processes

Introduction, Signal Concepts, Signal Functions, SIGCLD Semantics, Kill and Raise functions, Alarm and Pause Functions, Signal Sets, sigprocmask Function, sigpending function, sigaction function, sigsetjmp and siglongjmp functions, sigsuspend function, abort function, system function, sleep, nanosleep and clock_nanosleep functions, sigqueue functions, job-control signals, signal names and numbers. 

Daemon Processes

Introduction, Daemon Characteristics, Coding Rules, Error Logging, Client-Server Model

Course outcome

● Demonstrate the basics of Unix concepts and commands.
● Demonstrate the UNIX file system.
● Apply comands to reflect changes in file system.
● Demonstrate IPC and process management.
● Develop an application/service over a Unix system.

Suggested Learning Resources

Text Books

1. Sumitabha Das., Unix Concepts and Applications., 4thEdition., Tata McGraw Hill
2. W. Richard Stevens: Advanced Programming in the UNIX Environment, 2nd Edition, Pearson Education, 2005 

Reference Books

1. Unix System Programming Using C++ – Terrence Chan, PHI, 1999.
2. M.G. Venkatesh Murthy: UNIX & Shell Programming, Pearson Education.
3. Richard Blum, Christine Brenham: Linux Command Line and Shell Scripting Bible, 2ndEdition, Wiley, 2014.

FOLLOW US

Scroll to Top