unix programming chapter basics
unix programming chapter basics
Experiment No. 1
AIM: Explain Unix programing also explain installation of unix operating system
Outcome:-
Unix programming is the creation of efficient, secure, and scalable applications that automate
tasks and interact with system resources.
Objectives :-
Understand Unix Installation and Learning Unix programing.
Theory: -
Introduction:
Unix programming is based on several core principles that make it a powerful and flexible
operating system for software development. The theory behind Unix programming includes the
following fundamental concepts:
Everything is a File:
In Unix, everything is treated as a file, including devices, processes, and directories. This
unified approach simplifies file handling. For example, hardware devices like printers or
network interfaces are accessed just like files.
Modularity:
Unix follows the principle of "small tools doing one thing well." This allows developers to
combine various utilities to build powerful applications by creating small, modular
components. For instance, text processing utilities like grep, awk, and sed can be
combined in pipelines to process data in real-time.
Multitasking and Process Management:
Unix supports multitasking and process management. Processes are created, scheduled,
and terminated by the kernel. Unix provides features like fork() (to create child processes)
and exec() (to run programs) for efficient multitasking. Inter-process communication
(IPC) and signals are used to manage processes and synchronize tasks.
Security and Permissions:
Unix employs a permission-based security model to control access to files and system
resources. Each file and process has an owner, group, and permission settings (read,
write, execute), which ensures that only authorized users can perform certain actions.
Shri Vaishnav Vidyapeeth Vishwavidyalaya, Indore
Shri Vaishnav Institute of Information Technology
Shell Scripting:
Unix shell scripting allows automation of tasks using command-line interfaces (CLI).
Shells like Bash provide scripting capabilities to automate system administration tasks,
file manipulation, and program execution. Scripts are sequences of commands that are
executed in a shell, enabling batch processing of tasks.
The main concept that unites all the versions of Unix is the following four basics −
Kernel: The kernel is the heart of the operating system. It interacts with the hardware and most
of the tasks like memory management, task scheduling and file management.
Shell: The shell is the utility that processes your requests. When you type in a command at your
terminal, the shell interprets the command and calls the program that you want. The shell uses
standard syntax for all commands. C Shell, Bourne Shell and Korn Shell are the most famous
shells which are available with most of the Unix variants.
Commands and Utilities: There are various commands and utilities which you can make use of in
your day to day activities. cp, mv, cat and grep, etc. are few examples of commands and utilities.
There are over 250 standard commands plus numerous others provided through 3rd party
software. All the commands come along with various options.
Files and Directories: All the data of Unix is organized into files. All files are then organized into
directories. These directories are further organized into a tree-like structure called the filesystem.
Shri Vaishnav Vidyapeeth Vishwavidyalaya, Indore
Shri Vaishnav Institute of Information Technology
Installing a Unix operating system involves setting up the environment where Unix can run and
ensuring that the system is configured to meet the user's needs. The key steps and theory behind
installing a Unix OS include:
1. Choosing the Distribution:
Unix systems come in different variants, such as Linux distributions (Ubuntu, Fedora),
FreeBSD, or macOS. The choice depends on the user's needs, such as hardware
compatibility, package management, and system features.
2. Creating Bootable Media:
The installation process begins with downloading the ISO file of the chosen Unix OS. This
ISO is then used to create bootable media (USB stick or DVD) using tools like Rufus (for
Windows) or dd (for Unix systems).
3. Partitioning and Disk Setup:
During installation, the system disk must be partitioned to create spaces for the operating
system, files, and data. This is typically done manually or automatically using an installer.
The partitioning scheme (e.g., MBR or GPT) is chosen based on the system’s needs.
4. Installation Process:
The installer guides the user through setting up language preferences, timezone, and user
accounts. The system will also install the base operating system along with additional
software packages, such as desktop environments (for graphical interfaces), utilities, and
development tools.
5. System Configuration:
After installation, the system needs to be configured for networking, user permissions,
and system services. This includes setting up the network interface, configuring the
firewall, and ensuring the system is ready for regular use.
6. Post-Installation Updates:
After installation, it is essential to update the system to ensure that the latest security
patches and software packages are applied. This can be done via package managers like
apt (Ubuntu), yum (CentOS), or pkg (FreeBSD).
7. Rebooting and Booting into Unix:
Once installation and configuration are complete, the system is rebooted. The Unix
operating system will boot into its default shell or graphical environment, where users can
begin interacting with the system.
Shri Vaishnav Vidyapeeth Vishwavidyalaya, Indore
Shri Vaishnav Institute of Information Technology
Experiment No. 2
Outcome:-
studying Unix general-purpose utility commands is mastering efficient file, process, and system
management through powerful command-line tools.
Objectives :-
Understanding Unix General-Purpose Utility Commands
Theory: -
Introduction:
Unix is a powerful, multi-user, multitasking operating system that provides a vast array of utility
commands to manage files, processes, system resources, and network activities. These general-
purpose utility commands form the core set of tools that users and system administrators rely on
to perform day-to-day operations efficiently. From file management to process monitoring, text
manipulation, and system configuration, Unix utilities offer flexibility and control through the
command-line interface (CLI). Understanding these utilities is crucial for effectively working with
Unix-based systems, as they enable users to automate tasks, troubleshoot issues, and manage
system resources in a streamlined and efficient manner.