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

os file1

The document is a practical file for an Operating Systems course, detailing the study of Windows and Linux operating systems. It covers the history, versions, kernel architecture, shell commands, and basic commands for both operating systems. Additionally, it includes various command functionalities and examples for practical understanding.

Uploaded by

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

os file1

The document is a practical file for an Operating Systems course, detailing the study of Windows and Linux operating systems. It covers the history, versions, kernel architecture, shell commands, and basic commands for both operating systems. Additionally, it includes various command functionalities and examples for practical understanding.

Uploaded by

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

Guru Jambheshwar University of

Science and Technology

Practical File of Operating System

Submitted To: Submitted By:


Dr. Anupma Sangwan Prince
Assistant Professor, Roll No.:
23001014007
CSE Department, Class: B.Tech IT
GJUS&T, Hisar Sem: 4th Sem
Year: 2nd Year
Study of WINDOWS and Linux operating system
(a). Study of WINDOWS operating system

History of Windows Operating System


The first version of Windows, Windows 1.0, was released in November 1985. Later many versions
with improvised features, GUI, and performance were released. The latest version of windows is
Windows 11, which was released in October 2021.

GENERATIONS OF WINDOWS:
WINDOWS 1: 1985
WINDOWS 3.1: 1992
WINDOWS 95: 1995
WINDOWS XP: 2001
WINDOWS VISTA: 2006
WINDOWS 7: 2009
WINDOWS 8: 2012
WINDOWS 10: 2015
WINDOWS 11: 2021

It was 1983 when work on “Interface Manager” was started by Microsoft but it was in November
1995, when the first Windows 1.0 was introduced. Later on, with developments in technology, the
requirement of the people and increased demand for Graphical User Interface, Microsoft kept
releasing revised versions of Operating Systems .

In 1995, perhaps the most widely used version yet, Windows 95 was born. At this point, it ran ona
16-bit DOS-based kernel and 32-bit userspace to enhance the user experience.
Windows hasn’t changed a whole lot in terms of core architecture since this version despite vast
amounts of features that have been added to address modern computing.

Versions of Windows
Various versions released over time to meet different needs:

- Windows 1.0 to 3.1: Basic GUI introduction.


- Windows 95, 98, ME: Improved UI, internet features.
- Windows NT Series: Focused on business with stability.
- Windows 2000: Combined ease and robustness.
- Windows XP: Unified consumer and business use.
- Windows Vista: Introduced Aero and security updates.
- Windows 7: Performance boost and new features.
- Windows 8 & 8.1: Touch interface, Start Screen.
- Windows 10: Start Menu returns, virtual desktops.
- Windows 11: Redesigned UI, improved productivity.
WINDOWS Operating System
1. KERNEL
 Windows uses a proprietary hybrid kernel, built on the Windows NT architecture.
 The kernel is closed-source and maintained by Microsoft only.
 It is used in desktop, laptop, and enterprise systems.
 Users and developers cannot view or modify the kernel code.
 First major kernel release: Windows NT (1993).
2. SHELL
 Windows includes Command Prompt (CMD) and PowerShell as shells.
 CMD: Basic command-line interface with limited scripting ability.
 PowerShell: Advanced shell and scripting environment.
 Windows script files use extensions like .bat or .ps1.
 Shells are often used alongside the Graphical User Interface (GUI).

3. BASIC COMMANDS
 cd – Change or show current directory.
 dir – List files and folders in the current directory.
 echo. > file.txt – Create a new file.
 del file.txt – Delete a file.
 copy file1.txt file2.txt – Copy files.
 move file.txt newname.txt – Rename or move a file.
 type file.txt – Display file contents.
 cls – Clear the command prompt screen.

4. PIPES AND FILTERS


 Pipes are used to pass output from one command as input to another using |.
 Windows supports filters using commands like find, more, sort.
Examples:
 dir | more – View long directory listings page by page.
 tasklist | find "chrome" – Find specific running processes.
 PowerShell:
o Get-Content file.txt | Select-Object -First 5 – Display first 5 lines.
o Get-Process | Sort-Object CPU -Descending – Sort processes by CPU usage.
(b). Study of LINUX operating system

Linux is an open-source, Unix-like operating system based on the Linux kernel, first released by
Linus Torvalds in 1991. It is widely used across servers, desktops, mobile devices, embedded
systems, and supercomputers due to its stability, security, and flexibility.
Linux is named after Linus Torvalds (pronounced "LYNNus", hence "LYNN- ucks").
 He wrote the first Linux kernel in 1991.
 At the time, he was a Computer Science undergraduate student at the University of Helsinki,
Finland, and wanted a hobby project which he intended to release as a free OS
 Linus retains control of the Linux kernel to this day, through a small company, though he also has
(had?) a day job in Silicon Valley.
 He had some technical differences with Minix and with its creator (Professor Andrew
Tannenbaum, Computer Science, at a university in the Nederland), and so Linus wanted to do it his
way.

History:
Linux is a modem, free operating system based on UNIX standards.
 First developed as a small but self-contained kernel in 1991 by Linus Torvalds, with the major
design goal of UNIX compatibility.
 Its history has been one of collaboration by many users from all around the world, corresponding
almost exclusively over the Internet.
 It has been designed to run efficiently and reliably on common PC hardware, but also runs on a
variety of other platforms.
 The core Linux operating system kernel is entirely original, but it can run much existing free
UNIX software, resulting in an entire UNIX-compatible operating

LINUX OPERATING SYSTEM


1. KERNEL
 Linux uses a monolithic, modular kernel — open-source and freely available.
 Developed by a global community under the GNU GPL license.
 Linux supports multitasking, multi-user operation, and strong security.
 It is used in servers, desktops, embedded systems, and supercomputers.
 First release of the kernel: 1991 by Linus Torvalds.
2. SHELL
 Common shells include Bash, sh, zsh, and others.
 Shell provides a powerful interface for executing commands and scripting.
 Linux shell scripts use .sh extension.
 Shell is commonly used with or without a graphical environment.
 Bash is the most widely used default shell.

3. BASIC COMMANDS
 pwd – Print current directory path.
 ls – List contents of a directory.
 cd – Change directory.
 touch file.txt – Create a new empty file.
 rm file.txt – Remove a file.
 cp file1.txt file2.txt – Copy files.
 mv file.txt newname.txt – Move or rename files.
 cat file.txt – Show contents of a file.
 clear – Clear the terminal screen.

4. PIPES AND FILTERS


 Pipes ( | ) are used to pass output from one command to another.
 Filters are used to process data and refine output (like grep, sort, wc, etc.)
Examples:
 cat file.txt | grep "hello" – Find lines containing "hello".
 ps aux | grep firefox – Filter running processes related to Firefox.
 cat file.txt | sort | uniq – Sort and remove duplicates.
 ls -l | more – View long listings one screen at a time.
 head -n 5 file.txt – View the first 5 lines of a file.
 tail -n 10 file.txt – View the last 10 lines of a file.
 wc file.txt – Show line, word, and character count.
# OPERATING SYSTEM LAB FILE

1. pwd:- stands for "print working


directory".
• It will print the current folder
path.

2. mkdir :- stands for "make directory".


• you can create folder using mkdir command.

• you can create multiple folders with one command.

• you can also create nested folder using -p


option in mkdir command
• The -p flag creates parent directories as needed..

• This command can also be used to

create a hidden
• folder just add (.) in starting.
3. dir :-
• dir command in Linux is used to list the contents of a directory.

• For detailed information about each file, use the -l option

4. cd :-
• This command is used to change directory.

• To exit from any directory use (..) ahead of this command

5. rm :-
• The rm command is used to delete (remove) files or directories.

• It stands for "remove".

• rm -rf directory name (Forcefully delete all commands without


confirmation)
6. rmdir :-
• This command is used to delete a blank directory .

• This command is used to remove multiple directories at once


7. echo :- This command is used to directly print a message.

• This command can also be used to create a empty file

 This command can also be used to create a file with text in it.

8. touch :-
• This command is used to create new file
• If the file already exists this command will update the timestamp of
the file

• touch command can also be used to create a hidden file just start
the name with (.).

• -m option is used to update only the modification time of a file


9. stat :-
• This command is used to get statistical data of a file.

10. cat :-
• This command is used to insert text in any file and then print the
content of file.
• cat command can also be used to show contents of multiple files.

• cat command can also be used to concatenate two files in an another


file .

• If we use (-n) option with command then we can get number of lines
in a file
11. ls :-
• This command is used to list directory contents.

o The one in Blue is directory and other are files.

• -l option is used to list with detailed information.

• -a option is used to view all hidden files that one starting with .

12. sort :-
• It is used to sort lines of a file numerically, alphabetically
or in reverse order.

• To sort in reverse order use -r option


• To sort numerically use -n option
• -u option removes duplicated while sorting

13. mv :- It stands for "move".


• This command can be used to Move files/directories from one location
to another.
• This command can also be used to rename a file.

14. cp :-
 This command is used to copy file.

• This command can also be used to create a new file and copy the data
to that file
15. head :-
• This command can be used to print the starting 10 lines(default) of a
file.

• By using -n option we can print first n lines


• We can also see the first few lines of multiple files.

16. tail :-
• This command can be used to print last 10 lines (default) of a file.

• By using tail -n option you can print last n number of lines.


17. Find :-
• This command is used to search for files and directories within a
directory.

• it’s used to search for files and directories based on


name, type, size, date, and more.
18. tree :-
• The tree command shows a visual hierarchical structure of directories
and files.
• To install use command sudo apt install tree.

• tree -s is used to print sizes .


• tree -a is used to print hidden files in tree

• tree -d is used to print directories only


19. df :-
• The df command is used to display disk space usage of file systems.

• df -h is used to show specific file system


• df -T is used to Include file system type

20. top :-
• The top command is used to monitor system performance in real-time
• It shows CPU usage, memory usage running processes.
21. chown :-
• Chown command in Linux is used to change the ownership of files
and directories.

• We can also use chown command to change only the group


• We can also change both ownership and group at same time

22. history :- the history command in linux is used to view a list of previously
executed comman
23. man :-
• This command is used to get manual of any command q

24. whereis :-
• it is used to locate the binary, source and manual page
files for a command.

25. Ps :-

• The ps command is used to display information about running


processes.
• ps -e will show all ongoing processes.

• ps -aux command is used to get detailed view of all processes

• ps -u username command is used to see the process if a specific user.


26. free :-
• Free command is used to display the amount of free and used memory

• free-h This command is used to show values in human- readable


format

27. kill :-
• The kill command is used to terminate a running process using its
Process ID.

28. clear :-
• This command is used to clear the terminal screen
29. which
 It Shows the exact path to the executable used in your shell.

30. whereis
 It is used to locate the binary , source and manual page files for a
command.

31. sudo :-
• sudo command is used to install a package.
• create new user using

• sudo command i=can also be used to delete a user

32. chmod:-
 It is used to change permissions of a file.
 There are three types of access : owner , group , others
 There are three types of permissions also: read (r=4) , write (w=2) , execute
(x=1).
 User (u)
33. tar:-
• It is uses to create an archive file with .tar , .tar.gz , .tgz extensions.

 Here in -czvf stands for : c : create


z = gzip
v = verbose f
= filename

34. zip:-
 It is used to compress files and directories into .zip format.
 zip -r : recursively zips a directory.

 unzip files:-
35. sed:- It is used to edit or replace , insert or delete text in files.

36. Pipeline:- It is used to chain or combines two commands together.

37. Gpasswd:- It used for administer.

 Etc/passwd used to show user.

• gpasswd -a is used for add user .

• gpasswd -d are used for remove to user.

38. Id:-
It is ude to show user id group_id.
 BASIC VI COMMANDS
 To Start vi
 Command  Description
 vi filename  Create or edit file starting at
line 1
 vi -r filename  Recover file after system
crash

 To Exit vi
 Command  Description
 :x  Save and quit
 :wq  Save and quit
 :q  Quit without saving (if no
changes)
 :q!  Force quit without saving

 Moving the Cursor


 Command  Description
 j, <Return>  Move cursor down one line
 k  Move cursor up one line
 h, <Backspace>  Move cursor left
 l, <Space>  Move cursor right
 0  Move to start of current line
 $  Move to end of current line
 w  Move to beginning of next
word
 b  Move back to beginning of
previous word
 :0 or 1G  Move to first line in file
 :n or nG  Move to line n
 :$ or G  Move to last line in file

 Screen Manipulation
 Command  Description
 ^f  Move forward one screen
 ^b  Move backward one screen
 ^d  Move down (forward) half
screen
 ^u  Move up (backward) half
screen
 ^l  Redraw the screen
 ^r  Redraw screen, removing
deleted lines
 Adding, Changing, Deleting Text
 Command  Description
 u  Undo last change (toggle)

 Inserting or Adding Text


 Command  Description
 i  Insert before cursor, until
<Esc>
 I  Insert at beginning of line,
until <Esc>
 a  Append after cursor, until
<Esc>
 A  Append at end of line, until
<Esc>
 o  Open new line below
current line, until <Esc>
 O  Open new line above
current line, until <Esc>

 Changing the Text


 Command  Description
 r  Replace one character
 R  Replace characters
continuously until <Esc>
 cw  Change current word
 cNw  Change next N words
 c  Change current line from
cursor
 cc  Change entire line
 Ncc / cNc  Change N lines

 Deleting the Text


 Command  Description
 x  Delete character under
cursor
 Nx  Delete N characters
 dw  Delete word from cursor
 dNw  Delete N words
 D  Delete from cursor to end of
line
 dd  Delete current line
 Ndd / dNd  Delete N lines

 Cutting and Pasting Text


 Command  Description
 yy  Yank (copy) current line
 Nyy / yNy  Yank next N lines including
current
 p  Paste below current line

 Searching the Text


 Command  Description
 /string  Search forward
 ?string  Search backward
 n  Next match in same
direction
 N  Next match in opposite
direction

 Determining Line Numbers


 Command  Description
 :.  Show current line number
 :=  Show total number of lines
 ^g  Show current line number
and total lines

 Saving and Reading Files


 Command  Description
 :r filename  Insert contents of file after
current line
 :w  Save file
 :w newfile  Save to a new file
 :12,35w smallfile  Save lines 12–35 to
smallfile
 :w! prevfile  Overwrite and save to
existing file
Shell Scripting

AIM : Write a Shell Script to Perform Arithematic Operations Using Switch Case
Statement

Output:
AIM : Write a Shell Script To Implement Fibonacci Series

Output:
AIM : Write a Shell Script To Print Factorial of a Number

Output:

AIM : Write a Shell Script To sort a array


Output=

You might also like