0% found this document useful (0 votes)
12 views

os manual

The document outlines the curriculum for the Operating System course in the Bachelor of Technology program at the Faculty of Engineering and Technology. It includes a detailed index of practical experiments focusing on Linux commands, shell programming, and various programming tasks. Additionally, it provides an overview of Linux, its kernel, and different types of shells, along with basic Linux commands and text editors.

Uploaded by

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

os manual

The document outlines the curriculum for the Operating System course in the Bachelor of Technology program at the Faculty of Engineering and Technology. It includes a detailed index of practical experiments focusing on Linux commands, shell programming, and various programming tasks. Additionally, it provides an overview of Linux, its kernel, and different types of shells, along with basic Linux commands and text editors.

Uploaded by

Nirmit Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

FACULTY OF ENGINEERING AND TECHNOLOGY

BACHELOR OF TECHNOLOGY

Operating System
(303105252)

SEMESTER IV
Computer Science & Engineering Department
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

INDEX
SR.NO Page No Date of Marks
Experiment Performance Date of Sign
Title Submission
From To

1. Study of Basic LINUX Commands. 2 10 03-12-24

2. Study the basics of Shell Programming.

3. Write a Shell script to print given numbers


sum of all digits.

4. Write a Shell script to validate the entered


date (e.g., Date format is: dd-mm-yyyy).

5. Write a Shell script to check entered string


is palindrome or not.

6. Write a Shell script to say Good


Morning/Afternoon/Evening as you login to
system.

7. Write a C Program to create a child process.

8. Finding out biggest number from given


three numbers supplied as command line
arguments.

9. Printing the patterns using for loop.

10. Shell script to determine whether given file


exist or not.

11. Write a program for process creation using C


(Use GCC Compiler).

12. Implementation of FCFS and Round Robin


algorithms.

13. Implementation of Banker’s algorithm.

2303031050355
1
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

Practical – 1
Aim : Study of Basic LINUX Commands

Introduction to LINUX :-
Developed by Linus Torvalds in 1991, the Linux operating system is a powerful
and flexible open-source software platform. It acts as the basis for a variety of
devices, such embedded systems, cell phones, servers, and personal
computers. Linux, that’s well-known for its reliability, safety, and flexibility,
allows users to customize and improve their environment to suit specific
needs. It is similar to Unix, and it is built upon the Linux Kernel. The Linux
Kernel is like the brain of the operating system because it manages how the
computer interacts with its hardware and resources. It makes sure everything
works smoothly and efficiently.

Introduction to Shell :-
A shell is a special user program that provides an interface for the user to use
operating system services. Shell accepts human-readable commands from
users and converts them into something which the kernel can understand. It is
a command language interpreter that executes commands read from input
devices such as keyboards or from files. The shell gets started when the user
logs in or starts the terminal.

Types of Shell :-
Linux offers a variety of shells, each with unique features and capabilities. Some
of the most popular and widely used shells include:

1. Bash (Bourne-Again Shell): The most common default shell in Linux


distributions. It’s an enhancement of the original Bourne shell (sh),
incorporating features from other shells like ksh and csh.

2. sh (Bourne Shell): The original shell that was used on UNIX. It is simple
and fast but lacks many features of more modern shells.

2303031050355
2
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

3. Dash (Debian Almquist Shell): A variant of the Almquist Shell (ash).


Dash is used as the default /bin/sh on Debian-based systems because
of its speed and compliance with POSIX standards.

4. Ksh (Korn Shell): Offers many features, combining elements of both the
Bourne shell and C shell. It provides powerful programming features as
well as interactive use.

5. Csh (C Shell) and Tcsh (TENEX C Shell): Csh offers a syntax that is quite
similar to the C programming language, from which it derives its name.
Tcsh is an improved version of csh that includes command line editing
and completion.

6. Zsh (Z Shell): Combines many of the useful features of Bash, ksh, and
tcsh. It is known for its interactive use enhancements and extensive
customization capabilities.

7. Fish (Friendly Interactive Shell): Known for its user-friendly and


interactive features, like syntax highlighting, autosuggestions, and tab
completions.

Introduction to Kernel : -
The kernel is a computer program that is the core of a computer’s operating
system, with complete control over everything in the system. It manages the
following resources of the Linux system – • File management
• Process management

• I/O management

• Memory management

• Device management etc.

2303031050355
3
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

Basic LINUX Commands :- 1.


ls Command :-
The ls command is used to list files and directories in the current working
directory. This is going to be one of the most frequently used Linux commands
you must know of.

2. pwd Command :-
The pwd command allows you to print the current working directory on your
terminal. It’s a very basic command and solves its purpose very well.

3. cd Command :-
The cd command is one of the important Linux commands you must know, and
it will help you navigate through directories. Just type cd followed by directory

4. mkdir :-
The mkdir command allows you to create directories from within the terminal.

2303031050355
4
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

5. rm Command :-
The rm command is used to delete files and folders and is one of the important
Linux commands you must know. To delete a directory, you must add the -r
argument to it. Without the -r argument, the rm command won’t delete
directories.

6. touch Command :-
The touch command in Linux creates an empty file or updates the timestamp of
an existing file.

7. clear Command :-
This will clear the terminal screen and move the cursor to the top-left corner of
the screen.

8. cat Command :- he cat command, when used on our New-File, prints


the contents of the file.

9. tac Command :-
The tac command is the reverse of cat command, as its name specified. It
displays the file content in reverse order (from the last line).

2303031050355
5
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

10. echo Command :- echo command, it simply prints whatever


follows after the command.

11. uname Command :-


The uname command in Linux displays information about the system’s kernel,
including the kernel name, hostname, kernel release, kernel version, and
machine hardware name.

12. whoami Command :-


The whoami command in Linux returns the current user’s username. It stands
for “who am I?” and it’s often used to determine the current user’s identity in
shell scripts or the terminal.

13. head Command :-


The head command showed 10 lines from the top of the file.

2303031050355
6
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

14. whereis:-
Whereis in Linux is generally used to see the exact location of any command
typed after this. Let’s see how this performs.

15. ps Command :-
The ps command is used to display information about the current running
processes on the system.

16. mv Command :-
The mv command is generally used for renaming the files

17. ln Command :-
The ln command is used to create a shortcut link to another file.

2303031050355
7
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

18.. grep Command :-


The grep command is used to find a specific string in a series of outputs.

19. sort Command :-


The sort command is used generally to sort the output of the file.

20. df Command :- df command in Linux gets the details of the


file system.

21. wc Command :- wc command in Linux indicates the


number of words, characters, lines, etc.

22. cp Command :-
The cp command of Linux is equivalent to copy-paste and cut-paste in
Windows.

2303031050355
8
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

23. id Command :-
The id command is used to display the user ID (UID) and group ID (GID).

24. od Command :-
The od command is used to display the content of a file in different s, such as
hexadecimal, octal, and ASCII characters.

25. gzip Command :-


The gzip command is used to truncate the file size. It is a compressing tool. It
replaces the original file by the compressed file having '.gz' extension.

Practical 2

2303031050355
9
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester
Linux text editors:-
Linux text editors are essential tools for coding, writing, and system administration tasks. They come in various
forms, catering to different user preferences and use cases. Below are some of the most popular text editors available
in the Linux environment. Some examples are:

• Vi Text Editor
• Vim Editor
• Nano Editor
• Kate Editor
• Sublime Editor
• Atom Editor
• Emacs Editor

Shell Script
A shell script is a text file containing a sequence of commands for a Unix-based operating system's shell. It allows
users to automate tasks, execute commands, and manage system operations.

Basic Scripts:-
1. write a shell script that shows a basic conversation with the system.

Output:

2. write a script to add 2 numbers.

2303031050355
10
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

Output:

3. write a script to find if number is even or odd.

Output:

4. write a script to swap two numbers without using 3rd variable.

2303031050355
11
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

Output:

5. write a script to find an avg of 3 numbers.

Output:

Practical-3

2303031050355
12
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

1.write a shell script to add numbers as 1+2+3 if the input is 123

Output:

2. Write a shell script to make a table of any number multiple of the input
number upto 10

Output

2303031050355
13
Faculty of Engineering & Technology

Operating System (3031052 52 )


B. Tech CSE 2ndYear 4thSemester

2303031050355
14

You might also like