Please Subscribe My YouTube Channel

Friday, November 15, 2019


Operating System

    An operating system is a software program  that controls internal activities of the computer hardware and provides user interface. Applications programs need to interact with the operating system for using hardware resources.The operating system first loads (copied) the program into the computer’s main memory then the computer is turned on(switched on).Operating system that supports a single user at a time known as single user operating system,such as Windows XP. Some like Linux, Unix etc supports multiple users at a time.An Operating System performs  processor management, memory management coma input and output management, file management, security management etc.

We can operate the System in two ways:-


GUI and CUI are two types of user interface.


GUI stands for Graphical User Interface while CUI stands for Character User Interface.

(User Interface : User Interface comprises of everything the user can use to interact with the computer. It is basically the means by which the user and computer system can interact using input and output devices.


1. GUI ( Graphical User Interface)-


GUI stands for Graphical User Interface. This is a type of user interfacewhere user interacts with the computer using graphics. Graphics include icons, navigation bars, images etc. Mouse can be used while using this interface to interact with the graphics. It is a very user-friendly interface and requires no expertise. Eg: Windows has GUI.

2. CUI ( Character User Interface)-


CUI: CUI stands for Character User Interface. This is a type of user interface

where user interacts with computer using only keyboard. To perform any action a command is required. CUI also called CLI (command-line interface)It works by allowing the user to issue commands as one or more lines of text (referred to as command lines) to a program. Good examples CUIs are MS-DOS and the Windows Command Prompt.There are other command lines in addition to the ones mentioned above, namely, Terminal, and the Linux command line.


Here we learn about CUI Or CLI or We learn about commands:-

                     

     Dos (Disk Operating System)

 MS Dos stands for Microsoft Disk Operating System. It is also called command prompt  program.Because in this program we have learns about commands.
Command is a set of instructions or characters, user operate the system or interface with computer by characters so it is called Character User Interface (CUI) program.This program created by Bill Gates and Paul Allen in Microsoft Corporation in 1990.MS Dos is Originally released in 1991.



         


How to Open M.S.Dos


                                                                
OR
Start >> All Programs >> Accessories >> Command Prompt↩
OR
Hold Down Shift key and Right click on the screen And go to Open Command window here.

                                                               
                                                                     OR


Dos Commands:-
Dos Commands

1.Md(Make Directory):-

This command is used for Make the Directory(Folder) and Sub directory(Sub folder).



Syntax :-

C:\>Md Dir/Folder name 


C:\>Md 1st Dir 2nd Dir 3rd Dir……. .

2.Cd Or CHDIR(Change Directory):-

This command is used for change the directory or open directory, Back to home directory in one time and Back to directory in step by step.

OR

We can use cd command in different types:-For change directories or open any folder or subfolders.For go back to home (parent)directory from sub directories or child directories in one time.
For go back to home (parent)directory from sub directories or child directories in step by step.In simple words we can say when you want open any folder or directory (want move from one directory to other directory), go back (exit) from all sub directories and move on to parent directory in one time or step by step then we use this command.
For open or change a directory we use Cd or CHDIR with path name(directory name).For back to all directories in one time we use Cd\.For back to all directories and sub directories in step by step, We use Cd.. Syntax:- C:\>Cd Directory name↩(For Change/open Folder or Directory) C:\>Cd amar C:\amar>Cd vijay C:\amar\vijay>Cd..(For Back to Folder or Directory in step by step) C:\amar>Cd.. C:\> or C:\amar\vijay>Cd\(For Back to Folder or Directory in one time.)




(For change a directory or open a folder and subfolder:-


Syntax :- 
        
               C:\>Cd        Dir/Folder name

or

C:\>Chdir   Dir/Folder name



For Back to home directory or Main folder in one time:-


Syntax :-

             
               C:\>Cd\



For Back to directory or subdirectory in step by step:-


Syntax :-


               C:\>Cd..




3.Rd or Rmdir (Remove Directory):-

This command is used for Remove the Directory(Folder) and Sub directory(Sub folder).



Syntax :-

C:\>Rd Folder/Dir name
or

C:\>Rmdir   Folder/Dir name


Syntax :-

C:\A\b>Cd..

C:\A>Rd Dir/Folder name(B)

C:\A>Cd..

C:\>Rd Dir/Folder Name (A)



For Remove Dir And Sub Directories with Files in one Time with display confirmation message:-



Syntax :-

C:\>Rd   /S   MainFolder/Dir name

C:\>Rd   /S   A

(Note:-  /S means Subdirectory)





For Remove Dir And Sub Directories From Different Drives:-



Syntax :-

C:\>Rd Folder/Dir name Other drive Location\Folder/Dir name



C:\>Rd    A      F:\B



(Note:- /S means Subdirectory)


For Remove Dir And Sub Directories with Files in one Time without given Source Dir/Sub directory/File Name and without display confirmation message:-



Syntax :-

C:\>Rd   /S   /Q

(Note:-  /S means Subdirectory And /Q means Quit)




4.Copy Con(Copy Configuration):-
This command is used for Create the Files, Open the Created File, Combined Two or More Files and View on the screen.

For Create a file:-
    
     Syntax:-  C:\>Copy Con File name.Extension
C:\>Copy      Con      Ram.txt
Type Your information or matter.
.....................................................
.....................................................
.....................................................
..................................................... Press Ctrl+Z OR F6

1 File(s) copied.
{Note:- Press Ctrl+Z or F6 For Save your File Contents or Matter,as you press enter you will display a message on the screen (1 files copied), it means your file has been created.}

                    

For Open a file:-

    Syntax:- C:\>Copy  File name.Extension     Con
                     C:\>Copy       Ram.txt          Con

For Combined Two or More files:- 

Syntax:- C:\>Copy  First File name.Extension+Second File name.Extension+.......       Con
               C:\>Copy       Ram.txt+Shyam.txt+..........      Con
      
  

5.Fc(File Compare):-
This command is used for Compare two files in one time or we can say when you want view the contents or information of two files in one time then we use Fc command on dos window.


Syntax :-

C:\>Fc   First File name       Second File Nmae

C:\>Fc   Ram.txt       Ajay.xls


6.Type:-
This command is used for open a file or display the contents of file.
Syntax :-

C:\>Type   File name

C:\>Type  A.txt


7.Del(Delete):-
This command is used for delete the file.
Syntax :-

C:\>Del   File name


C:\>Del  A.txt

For Delete all files in one time from given sub directory:-
Syntax :-
C:\>Del    /S   Sub directory/Sub Folder name
C:\>Del    /S    A


For Delete all files in one time prompts for confirmation first for delete the files:-
Syntax :-
C:\>Del    *.*(Note:-Star dot Star)
C:\>Del    *.*

For Delete Read only Files:-
Syntax :-

C:\>Del     /AR   File name

C:\>Del     /AR   A.txt
(Note:- For make a read only /read and write file Type syntax:- C:\>Attrib +r / -r file name↩)




For Delete Hidden Files:-

Syntax :-

C:\>Del     /AH   File name
C:\>Del     /AH   A.txt
(Note:- For Hide/Unhide a file Type syntax:- C:\>Attrib +H / -H file name↩)

Fource To Delete a Read only File:-


Syntax :-

C:\>Del     /F   File name↩ (Note: /F means Force)
C:\>Del     /F   A.txt


For delete the file.Prompts confirmation First

Syntax :-

C:\>Del   File name     /P(Note: /P means Prompt)


C:\>Del  A.txt       /P




8.Erase:-
This command is used for Erase/Delete a file. If you want delete/remove/erase two or more files from current working directory  in one time then you can use this command.

Syntax :-

C:\>Erase   File name



C:\>Erase  A.txt

For Erase/delete two files or more files in one time:-

Syntax :-

C:\>Erase   First File     Second File   Third File.......



C:\>Erase  A.txt     B.txt      C.txt..........



For Erase/Delete All Files in one Time without given any Source file name:-

Syntax :-
C:\>Erase    *.*(Note:-Star dot Star)
C:\>Erase    *.*

For Erase/Delete all files in one time from given sub directory with confirmation message:-
Syntax :-
C:\>Erase    /S   Sub directory/Sub Folder name
C:\>Erase    /S    A
(Note:- You display a message for erase file
C:\c\*, Are you sure (Y/N)? y Deleted file - C:\c\a.txt

Note:- Press Y (Yes) for erase all files)

9.Ren(Rename):-
This command is used For Rename or modify a file Name and Directory and sub directory Name.

Syntax :-
C:\>Ren       Directory Name

C:\>Ren      A

C:\>Ren      File name
C:\>Ren      Ram.txt

10.Dir(Directory):-
This command is used For present files and directories list in current disk.

Syntax :- C:\>Dir  Switch
                C:\>Dir   /ON
There are different types of switches for listing directories and files:-
Switches       -       Effect
/P                          Page wise.
/W                        Width wise.
/S                          List all files and directories of Sub directories.
/AS                       Display directory with system files.
/AH                      Display directory with hidden files.
/AD                      Display only directory present in current drive.
/O                         Display list by file in sort order.
/ON                      Display directory list in sort order (A to Z).
/O-N                     Display directory list in sort order (Z to A).
/Q                         Display the owner of file.
/L                          Display directory and files in lower case.
/OD                      Display directory list by date/time (Oldest First)
/AR                      Display Read only directory and files.

11.Prompt:-
This command is used for set changes your Command prompt.

Syntax :-

C:\>Prompt    Switch
C:\>Prompt    $T

There are different types of switches for change your Prompt:-

Switches              -          Effect

$$                            Add a $ to your Prompt
$T                           Current Time
$D                          Current Date
$P                           Current Drive and Path name
$V                           System dos version no.
$Q                          The Equal Sign (=)
$B                           The Pipe Sign (|)
$N                           Current Drive
$G                           Grater Than (>)
$L                            Less Than (<)
$P$G                      C Prompt (C:\>)
$A$                         Ampersand (&)
$C                          Left parenthesis (
$F                           Right parenthesis )
$H                          Backspace (Erase previous character)



12.Date:-
This command is used for display system current date on the screen, and prompts the user to enter a new date or you can change the current date.


Syntax :-

C:\>Date
(As you press enter you display a message on the screen where you can display and change the date)

The current date is: Mon 11/18/2019 Enter the new date: (mm-dd-yy)


13.Time:-
This command is used for display system current time on the screen, and prompts the user to enter a new time or you can change the current time.


Syntax :-

C:\>Time
(As you press enter you display a message on the screen where you can display and change the time)

The current time is: 9:09:53.15 Enter the new time:

14.Ver(Version):-
This command is used for display version of the Microsoft Corporation Windows running on your computer.

Syntax :-


C:\>Ver
Microsoft Windows [Version 6.1.7601]


15.Vol(Volume):-
This command is used for display the disk volume label and serial number.

Syntax :-



C:\>Vol
Volume in drive C has no label. Volume Serial Number is F800-E728

16.Color:-
This command is used for Change Background color and Foreground color (Text color) of Dos window.
For displaying a color chart on the screen you can syntax on the dos window C:\>Color Code and press Enter, You diplay a Color code Chart on the Screen.

Color attributes are specified by TWO hex digits -- the first
corresponds to the background; the second the foreground.  Each digit

can be any of the following values.


 0 = Black       8 = Gray
 1 = Blue         9 = Light Blue
 2 = Green      A = Light Green
 3 = Aqua       B = Light Aqua
 4 = Red          C = Light Red
 5 = Purple     D = Light Purple
 6 = Yellow     E = Light Yellow
 7 = White      F = Bright White.

Syntax :-



C:\>Color    1E↩ (Not:- The first Code 1 is for Background color and Second Code E is for Foreground color or Text color)

17.
                  ⇐ Linux/Unix

What is Linux ?


Linux is a multi user, multitasking (Many persons can use one machine at the same time)
operating system, also called time sharing operating system or a clone (नक़ल) of Unix.


What is Unix ?


Unix is a multitask and multi user operating system, developed in 1969 at AT's & T (American Telephone and Telegraphs) Bell Labs by :- Ken Thomson ('Unix'),Denis Ritchie ('C'), Douglas Mellroy                
Linux is developed in August 25, 1991 by Linus Benedict Torvalds and has an official mascot (शुभ चिन्ह या लोगो पिक्चर) Penguin (A bird), which was choosen by Linus Torvalds.Linux is 32 Bit operating system or originally developed for 32 bit operating system P.C. Linux was written in C Language.Linux Os comes in very varieties which are called Distributions like - Debian, Ubuntu, Fedora, Centos, Red head, Opensuse, Kali Linux, etc.Linux is distributed a free software under a free software licence called the GNU/GPL (General Public Licence)


Note:- In 1994 the first version of Linux Kernel was on internet.

Note:- Bit are the formed by 0 (zero) and 1 (one), 32 bit based operating system or    
microprocessor can handle a combination of 32 bit at a time such as 01001110001001110001011001001110. 

Note:- The most popular 8 Bit microprocessor is Intel-8050.

Note:- 64 Bit microprocessor are used in very powerful minicomputers and workstations. An important 64 Bit microprocessor based computer is DEC- C (Digital Equipment Corporation) alpha server.


Advantage of Linux:- 

  • Linux is a open source operating system (which means we have received it free of cost from internet with legal licence.
  • It is full secured (which means there are no need to any antivirus for this operating system)
  • It is also work on GUI (Graphical User Interface) and CUI  (Command User Interface)
  • It's window is called X windows
  • It is Stable (It almost never crashes)

Disadvantage of Linux:-

  • All windows programs (Windows 7, Windows 8, Windows 10) are not run on the Linux.
  • For operate the Linux we should have the best knowledge on the command.
  • Hardware manufactured doesn't prepare drivers for linux operating system.

Why should you learn Linux ?

  • Google, Facebook and many other measure Internet sites use Linux Os.
  • Airplane and Auto-mobiles entertainment system and recent TV's run on Linux Os.
  • Even satellites and space centers use Linux Os.
  • Linux is used to run Robots in automatic manufacturing factories and more like in super computers.
  • Android phone and most of the smart phone are running Linux..

⏪ -: Elements of Linux: - ⏩


Kernel:-

                     Kernel is at the core of Linux operating system Or main part of  Linux program. It is loaded into the memory as soon as the system startup and be loaded until you shutdown the machine or system.

Kernel is memory resident portion of Linux because it loaded into the memory first. It manages inpot and output (peripherals devices), maintaining time and date launching applications and error handling. In simple words we can say it control hardware (C.P.U), memory, etc.
There are need a permission to operate all hardware, so Kernel allows or control all hardware's, so it is called nervous system or function manager of operating system process. Kernel is a Heart of an operating system..

Shell:-

                 A Shell is a computer program that interface between User and Linux/Unix.
The  shell surrounds of the kernel and interface between User and kernel. In Shell we can write the programs, comments, script. In  simple words shell is the layer of programming that understands and executes the commands which is entered by User.
The first Shell  Bourne Shell in 1969.  the original Unix shell was written in the mid-1970  by Stephane R. Bourne at the AT & T's Bell Labs New Jersey, and most successful  shell Bourne Again Shell (It is updated version of Bourne Shell) And released by GPL ( General public licence )
Shell is the interpreter program. It is interface between kernel and kernel interface between hardware.It will take the input from input devices such as  keyboard and will send to kernel,Karnal
will send to hardware. hardware will execute send back reply to Karnal, 
kernel to shell and shell will display the output.

-: How to check type of Shell :- 

1. Search Terminal or Press Ctrl+Alt+T, Terminal will be opened on the screen.

2. $echo space $shell ↩ ($echo $shell)
3. $shell=bin/Bash↩
4. $echo space $shell ↩ ($echo $shell↩)

Note:- (Type the syntax no 3. for change your shell and Type the syntax no 4. for check again your shell)
Note:- (उपर्युक्त Syntax में Space की जगह पर आपको रिक्त स्थान रखना है .)

 

-: File System & File Structure :-


 Linux keeps all the devices and data in form of files in different locations.  It contains a Root directory, sub directories and files.So basically you should understand what   this folder contains. my everything you will find that is your slash ( / ) which is called the front slash or mount  point Or Root. Under than mount point you will find a different directories.For open a root directory slash ( / ).

You type command in Terminal :-

                          $cd /

Then  type :-
                          /$ls (एल एस)

Now you can see a Linux directory structure or directory tree of the Linux file system  appears on the terminal

Note:-  Some files system and directories structure In one Linux distributions may be Different from other Linux distributions.

1. / – Root

  • Every single file and directory starts from the root directory.
  • Only root user has write privilege under this directory.
  • Please note that /root is root user’s home directory, which is not same as /.

2. /bin – User Binaries

  • Contains binary executables.
  • Common linux commands you need to use in single-user modes are located under this directory.
  • Commands used by all the users of the system are located here.
  • For example: ps, ls, ping, grep, cp.

3. /sbin – System Binaries

  • Just like /bin, /sbin also contains binary executables.
  • But, the linux commands located under this directory are used typically by system aministrator, for system maintenance purpose.
  • For example: iptables, reboot, fdisk, ifconfig, swapon

4. /etc – Configuration Files

  • Contains configuration files required by all programs.
  • This also contains startup and shutdown shell scripts used to start/stop individual programs.
  • For example: /etc/resolv.conf, /etc/logrotate.conf

5. /dev – Device Files

  • Contains device files.
  • These include terminal devices, usb, or any device attached to the system.
  • For example: /dev/tty1, /dev/usbmon0

6. /proc – Process Information

  • Contains information about system process.
  • This is a pseudo filesystem contains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid.
  • This is a virtual filesystem with text information about system resources. For example: /proc/uptime

7. /var – Variable Files

  • var stands for variable files.
  • Content of the files that are expected to grow can be found under this directory.
  • This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);

8. /tmp – Temporary Files

  • Directory that contains temporary files created by system and users.
  • Files under this directory are deleted when system is rebooted.

9. /usr – User Programs

  • Contains binaries, libraries, documentation, and source-code for second level programs.
  • /usr/bin contains binary files for user programs. If you can’t find a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp
  • /usr/sbin contains binary files for system administrators. If you can’t find a system binary under /sbin, look under /usr/sbin. For example: atd, cron, sshd, useradd, userdel
  • /usr/lib contains libraries for /usr/bin and /usr/sbin
  • /usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2

10. /home – Home Directories

  • Home directories for all users to store their personal files.
  • For example: /home/john, /home/nikita

11. /boot – Boot Loader Files

  • Contains boot loader related files.
  • Kernel initrd, vmlinux, grub files are located under /boot
  • For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic

12. /lib – System Libraries

  • Contains library files that supports the binaries located under /bin and /sbin
  • Library filenames are either ld* or lib*.so.*
  • For example: ld-2.11.1.so, libncurses.so.5.7

13. /opt – Optional add-on Applications

  • opt stands for optional.
  • Contains add-on applications from individual vendors.
  • add-on applications should be installed under either /opt/ or /opt/ sub-directory.

14. /mnt – Mount Directory

  • Temporary mount directory where sysadmins can mount filesystems.

15. /media – Removable Media Devices

  • Temporary mount directory for removable devices.
  • For examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writer

16. /srv – Service Data

  • srv stands for service.
  • Contains server specific services related data.
  • For example, /srv/cvs contains CVS related data.

-: Terminal:-


The Terminal is an interface in which you can type and execute text-based commands.

Or We can say on the Terminal we can type the commands or can do CUI (Command User Interface) work.


How to open terminal ?


1.Open the dashboard or application Window  by using Super key (That is Known as Window logo button aur Start button)


 2.Type Terminal.

                                           or

You can use the keyboard shortcut Ctrl + Alt + T  key for open the Terminal window.You can open the Terminal by Using right click on the monitor screen and select Open Terminal option.


  


-: Command :-

   

Linux command is a series of character consists of   word (that you type). Linux commands are case sensitive. That is CP  is different from cp. As you know In Windows, commands are not  case sensitive, Windows not accept same commands  or name, that will message you the directory already exist.

Finally we can say LINUX operating system accept the same commands or name, which means you can create multiple folders with one name or same name.

         

Now we learn how to use the commands on Terminal or working with CUI / CLI (Character User interface / Command Line Interface) :--------------------


Let us now start:-



1. pwd (Present working directory) -

To find out which directory you are currently working. Or We can say this command prints the absolute path name of your current working directory.
     
                  Type syntax:- 
                                                $pwd   ↩

2. mkdir (Make directory) -


To create a folder and subfolders or  directory and subdirectories. In Linux opearating system we can create same directories but not in windows (Microsoft Windows), because Linux Os files or directories are case sensitive so we can type for create or make a directory.

Note:- mkdir is an internal dos command that creates folders. In dos mkdir and md are two form of command but mkdir is the Linux command not md [it means only mkdir command works in Linux Os but dos accepts both commands mkdir and md for create folder or subfolder. Remember Folder is also known as directory/parent directory/main directory and subfolder known as subdirectory/child directory.]


Note:- बना हुआ पहला फोल्डर, "मेन फोल्डर /डायरेक्टरी/पैरेंट डायरेक्टरी/मेन डायरेक्टरी के नाम से जाना जाता है ,तथा इसके अंदर बने हुए सारे फोल्डर, सबफ़ोल्डर/सब डायरेक्टरी/चाइल्ड डायरेक्टरी" के नाम से जाने  जाते है.
     
                  Type syntax:- 
                                                $mkdir     Directory Name↩
                                                $mkdir     A↩
                                                $mkdir     a↩

💢 For create Multiple directories / Main folders /  Parent directories in one time :-

            Type syntax:- 

                                                
                                                $mkdir     I Dir II  Dir III Dir   ........ ↩
                                                $mkdir     A B              C .........↩

💢 To create a number of Directories by using mkdir command in one time and create Multiple child directories under the Main folders/ Parent directories:-


Type syntax:- 
                                                
         $mkdir     Main dir ↩
         $mkdir      Main dir/Child dir     Main dir/Child dir Main dir/Child Dir↩
         
         $mkdir             A↩
         $mkdir             A/B A/C A/D↩

Note:- First you will create main dir A, Then you will create child dir B,C,D under the Parent Directory


💢 If you want to create Parent directory and child directories in one time according to given below structure 

then you:-

Type syntax:- 

$mkdir      -p Main dir/Child dir/Child dir     Main dir/Child dir/Child dir     Main dir/Child Dir↩
  
   $mkdir      -p A/B/E       A/C/F A/D↩

Note:- The means of letter  -p is Parent directory
Here, first create a parent directory 'A' and then creates all sub directories, if there are already exist parent directory 'A' then it will be not created the parent directory 'A'and creates all sub directories or child directories.


💢 If you want display or view all created directory and sub directories on terminal window (print a message on terminal at the time of creation folder and subfolders.):-



then you:-

Type syntax:- 

 $mkdir      -pv Main dir/Child dir/Child dir Main dir/Child dir/Child dir Main dir/Child dir
  
 $mkdir      -pv A/B/E     A/C/F   A/D↩  
                                                                         Note:- (-p means Parent and v means View)

                                                

3. cd (Change directory) -


We can use cd command in different types:-
For change directories or open any folder or subfolders.
For go back to home (parent)directory from sub directories or child directories in one time.
For go back to home (parent)directory from sub directories or child directories in step by step.In simple words we can say when you want open any folder or directory (want move from one directory to other directory), go back (exit) from all sub directories and move on to parent directory in one time or step by step then we use this command.



  • For change directories or open any folder or subfolders.

Type syntax:- 
                                                
                                               $cd     A↩
                                               ~/a$cd   D↩
                                               ~/a/d$

💢 For Change or open many Directories/folders or move to more subdirectories in one time:-




Type syntax:- 
                                                
                                               $cd     Parent dir/child dir/child di↩
  • For go back to home (Parent)directory from sub directories or child directories in one time.





  • For go back to home (parent)directory from sub directories or child directories in step by step.