operating-system

This repository contains a collection of shell scripts and C programs related to basic operating system functionalities. Each experiment is organized into separate folders (Exp 1 to Exp 8). Here's a brief overview of each experiment:

Exp 1: Basic Calculator

  • Script: basicCalculator.sh
  • Description: This shell script implements a basic calculator functionality allowing users to perform addition, subtraction, multiplication, and division.

Exp 2: Combinations and File Comparison

  • combinations.sh: Generates all combinations of the numbers 1, 2, and 3.
  • fileCompare.sh: Compares two input files and determines if they are the same.

Exp 3: End of Script and Reverse Number

  • endOfScriptAtEND.sh: Allows the user to input lines into a file until they type "end" or "END."
  • reverseNumber.sh: Reverses a user-input number.

Exp 4: Head and Tail Commands

  • scriptOfHead.sh: Simulates the head command of bash.
  • scriptOfTail.sh: Simulates the tail command of bash.

Exp 5: Directory Management

  • Script: Exp5.sh
  • Description: Manages directories with features such as listing directories, creating directories, modifying directories, and navigating.

Exp 6: Database Management System (DBMS)

  • database.txt: Database file to store student details.
  • DBMS.sh: Manages student details in the database, allowing for addition, deletion, and modification.

Exp 7: Fork Process in C

  • File: Exp7.c
  • Description: C code demonstrating the use of the fork system call to create child processes and obtain process IDs.

Exp 8: Custom Grep Command

  • grep.c: A C program replicating the grep command in Linux.
  • test.txt: A sample text file with 10 lines for testing the custom grep command.
How to Execute Grep Command:
  • Compile the grep.c file.
  • Run the compiled executable with the following commands:
  • ./grep test.txt contains life (to find lines containing "life").
  • ./grep test.txt notcontains life (to find lines not containing "life").
  • ./grep test.txt print (to print the entire text file).

Feel free to explore each experiment folder for detailed scripts and functionalities. If you encounter any issues or have suggestions, please open an issue in the repository.