Operating System: Semester 5
Operating System: Semester 5
SYSTEM
SEMESTER 5
UNIT - 1
HI COLLEGE
SYLLABUS
UNIT - 1
HI COLLEGE
INTRODUCTION
Processes jobs in batches, reducing the risk of errors and improving system
stability.
Requires fewer resources and can handle a larger number of jobs
simultaneously, making it more cost-effective than interactive systems.
Provides simplicity and reliability since there is no user interaction during
job execution.
Reduced response time: Since jobs are executed in shorter time slices, users
can receive faster responses and feedback, improving the overall
responsiveness of the system.
Time-Sharing Systems
In the context of operating systems, a time-sharing system is a type of
interactive system that allows multiple users to access the same computer
resources simultaneously. Here are some points about time-sharing systems:
2. Resource sharing: Multiple users can access the same computer resources
simultaneously, including CPU time, memory space, and input/output devices.
Personal-computer systems
In the context of computing, a personal computer (PC) is a microcomputer
designed for individual use. Here are some points about personal-computer
systems:
6. Storage: Personal computers use storage devices such as hard drives, solid-
state drives (SSDs), and flash memory to store data and programs.
Parallel systems
In the context of computing, a parallel system is a computer system that can
perform multiple operations simultaneously. Here are some points about
parallel systems:
4. Scalability: Parallel systems are highly scalable, allowing for the addition of
new processors as needed to increase system performance and capacity.
4. Scalability: Distributed systems are highly scalable, allowing for the addition
of new nodes as needed to increase system capacity and performance.
Real-Time Systems
In the context of computing, a real-time system is a computer system that is
designed to respond to external events or inputs within a specified time
constraint. Here are some points about real-time systems:
1. Kernel: The Linux kernel is the core of the operating system. It manages
hardware resources, schedules processes, and provides system services such as
memory management, process management, and device drivers.
2. Init: The init process is responsible for starting other processes and services
when the system boots up. It also manages user sessions and handles system
shutdowns.
3. Shell: The shell is the user interface for interacting with the operating system.
It provides a command-line interface for executing commands and scripts.
1. Root directory (/): The root directory is represented by a single forward slash
(/) and contains all other directories and files in the system.
2. Home directories (/home): Each user has a home directory, which is created
automatically during the user account creation process. The home directory for
the root user is /root.
3. System directories (/dev, /etc, /lib, /opt, /proc, /sbin, /sys): These directories
contain system-specific files and configurations. Some of these directories are
hidden by default, but can be accessed using the ls -a command.
6. Mount points (/media, /mnt): These directories are used to mount external
storage devices such as USB drives and CD/DVD drives.
7. Log files (/var/log): This directory contains log files generated by various
system services and applications.
2. info: The info command is similar to man, but provides more detailed
information in a hypertext format. To use info, type info followed by the
command you want to learn about. For example, info ls will display the info
page for the ls command.
3. help: The help command is used to display help messages for built-in shell
commands. To use help, simply type help followed by the command you want
to learn about. For example, help cd will display the help message for the cd
command.
6. cat: The cat command is used to display the contents of a file on the screen.
To use cat, simply type cat followed by the filename you want to view. For
example, cat myfile.txt will display the contents of myfile.txt on the screen.
7. mkdir: The mkdir command is used to create a new directory or folder. To use
mkdir, simply type mkdir followed by the name of the new directory or folder
you want to create. For example, mkdir mynewfolder will create a new
directory called mynewfolder in your current working directory.
10. mv: The mv command is used to move or rename files and directories within
your file system (local or remote). To use mv, simply type mv followed by the
name of the file or directory you want to move or rename (source), followed by
its new name or location (destination). For example, mv myfile.txt
/home/user/mynewfolder will move a file called myfile.txt into a directory called
mynewfolder in your home directory (assuming your username is user).
Alternatively, mv myfile1 myfile2 will rename a file called myfile1 to myfile2 in
your current working directory (assuming it's not already taken).
11. cp: The cp command is used to copy files and directories within your file
system (local or remote). To use cp, simply type cp followed by the name of the
file or directory you want to copy (source), followed by its new location
(destination). For example, cp myfile1 myfile2 will create a copy of a file called
myfile1 and save it as myfile2 in your current working directory (assuming it's
not already taken). Alternatively, cp -r /home/user/mydirectory
/media/backup/mybackupdirectory will copy an entire directory called
mydirectory from your home directory into a backup directory called
mybackupdirectory on an external storage device called /media/backup
(assuming your username is user and your backup device is mounted at
/media/backup).
12. rm: The rm command is used to delete files and directories within your file
system (local or remote). To use rm, simply type rm followed by the name of the
file or directory you want to delete (source). For example, rm myfile1 will delete
a file called myfile1 in your current working directory (assuming it exists).
Alternatively, rm -r /home/user/mydirectory will delete an entire directory
called mydirectory in your home directory (assuming your username is user and
it's empty). Use caution when using rm with directories as it will delete all files
and subdirectories contained within!
14. pwd: The pwd command is used to display the full path and location of your
current working directory or folder (absolute). To use pwd, simply type pwd
without any arguments or options (just pwd). For example, pwd will display
something like /home/user if your username is user and you're currently
working in your home directory!
15. date: The date command is used to display the current date and time in
various formats (either local or UTC timezones). To use date, simply type date
followed by various options and arguments as needed (either with quotes
around them if they contain spaces!). For example, date +%Y-%m-%d_%H-%M-
%S will display something like 2021-06-04_14-05-06 if today's date and time are
June 4th 2021 at 2:05 PM UTC! Alternatively, date --utc --rfc-3339=date can be
used for UTC timezone formats that conform with RFC 3339 standards!
16. cal: The cal command is used to display various calendar views based on
different months and years (either local or UTC timezones). To use cal, simply
type cal followed by various options and arguments as needed (either with
quotes around them if they contain spaces!). For example, cal -y 2022 displays a
yearly calendar view for 2022 starting from January 1st through December 31st!
Alternatively, cal -m 6 displays a monthly calendar view for June 2022! Useful
for planning events and deadlines based on different months and years!
17. Echo: The echo command is used to display a message or string of text on
the screen. To use echo, simply type echo followed by the message or string you
want to display. For example, echo "Hello, world!" will display the message
"Hello, world!" on the screen.
19. Ls: The ls command is used to list the contents of a directory or folder (either
with or without options and arguments as needed). To use ls, simply type ls
followed by the name of the directory or folder you want to view (either with
quotes around it if it contains spaces!). For example, ls mydirectory will display a
list of files and subdirectories contained within a directory called mydirectory in
your current working directory (assuming it exists)! Useful for quickly viewing
the contents of directories without needing to open a graphical file manager
program!
20. Who: The who command is used to display information about currently
logged-in users on your system (either with or without options and arguments
as needed). To use who, simply type who without any arguments or options
(just who). For example, who will display a list of currently logged-in users on
your system along with their login times and terminal sessions! Useful for
quickly checking who's currently logged into your system and what they're
doing!
21. Whoami: The whoami command is used to display your current username or
login ID (either with or without options and arguments as needed). To use
whoami, simply type whoami without any arguments or options (just whoami).
For example, whoami will display your current username or login ID (useful for
quickly checking what username you're currently logged into your system as)!
2. Moving around: In vi, you can move around the text using the following keys:
3. Inserting text: To insert text in vi, press `i` to enter insert mode. You can then
type your text and press `Esc` to exit insert mode and return to command
mode.
2. Insert Mode: To enter Insert Mode, press the i key in Command Mode. In this
mode, you can type text just like you would in any other text editor. To exit
Insert Mode and return to Command Mode, press the Esc key.
3. Last Line Mode: This mode is entered automatically when you add a new line
to the file or when you move to the last line of the file. In this mode, you can
add text to the last line of the file without having to move back to it using
normal navigation commands. To exit Last Line Mode and return to Command
Mode, press the Esc key.
Note that some distributions of Linux may have different vi editors installed by
default, such as Vim or Nano, which may have additional modes or features
beyond these three basic modes.
3. Type in the shell commands you want to execute in your script. Make sure to
save the script with a `.sh` extension, as this is the standard extension for shell
scripts.
4. To save and exit vi, press `Esc` to enter Command Mode, then type `:wq` and
press Enter. This will save the changes you made and exit vi.
5. To execute the script, open a terminal window and navigate to the directory
where you saved the script. Then, type `bash myscript.sh` (replace "myscript.sh"
with the name of your script) and press Enter. This will execute the script using
the Bash shell.
Alternatively, you can make your script executable by adding a shebang line at
the beginning of the script, like this:
```sh
#!/bin/bash
```