SlideShare una empresa de Scribd logo
1 de 123
Linux Operating System

      CA 102/CS 104

                Kalyani Neve.
A Brief History of Linux
1991 August

• Linux is introduced by Linus
  Torvalds, a student
  university of “Helsinki” in
  Finland.
• While the linux you know
  today was developed with
  assistance of programmer.
• Linus Torvalds still remain
  control of the evolving core
  of Linux O.S. :The Kernel

.                                Linus Benedict Torvalds
A Brief History of Linux
1992,March

• In March 1992 Version 1.0
  of Kernel came into
  market ,the first official
  release of Linux.
• At this point Linux RAM
  most of the common Unix
  tool from compiler to
  networking software to
  “X-Windows”.                  Linus Benedict Torvalds
A Brief History of Linux
1991 September

  Version 0.01 of Torvald's project is made
  available via ftp.funet.fi.
  Ari Lemmke, the systems administrator,
  gives the directory the name Linux.

  Linus had originally intended to call the new
  kernel "Freax".

  According to Wikipedia, the name Linux was
  actually invented by Ari Lemmke who
  maintained the ftp.funet.fi FTP server from
  which the kernel was originally distributed.
                                                  Ari Lemmke
A Brief History of Linux
October 1991
  Richard Stallman expresses interest in having the
  Free Software Foundation distribute a GNU system
  with the Linux kernel.

December 1991
  Robert Blum posts the first Linux FAQ

January 1992
  Minix creator Andrew Tannenbaum claims "Linux
  is obsolete" in a posting to comp.os.minix and
  starts a public discussion on the merits of Linux in
  which Linus Torvalds participates.
A Brief History of Linux
• First Linux "distribution", called MCC Interim Linux
  is released by the University of Manchester,
  England. (February 1992)

• Version 0.95 of the Linux kernel released. First
  version to be able to support X-Window. (March
  1992)

• A Linux distribution called Softlanding Linux
  System (SLS) is released. (September 1992)

• Software und System Entwicklung GmbH (SuSE)
  founded in Nuremberg, Germany. Distributes a
  German version of SLS with corresponding
  manuals. (November 1992)
A Brief History of Linux
1993:
• Version 1.0 of Slackware released by Patrick
  Volkerding. It is based on the SLS distribution.
• Ian Murdock creates the Debian distribution.
1994:
• Linux kernel version 1.0 released.
• First issue of Linux Journal published Marc Ewing
• Linux distributor Caldera founded by
  Ray Noorda of Novell & Ransom Love. Marc Ewing
• Marc Ewing releases the first version of Red Hat
  Linux.
A Brief History of Linux
1995:
• Bob Young partners with Marc Ewing
  and forms Red Hat Software.
• Apache web server project started
  as a series of patches to the NCSA
  HTTPd server (A Patchy server).

1996:
• Linux kernel version 2.0 released.
A Brief History of Linux
• Linus Torvalds suggests that
  a "slightly overweight
  penguin" would be the best
  mascot for Linux. He
  recommends Larry Ewing's
  "Tux" penguin images.



                      A Tuxedo
                                 Tux
A Brief History of Linux
• The following filed a suit against William R. Della
  Croce, Jr. (September 1996)
   –   Linus Torvalds
   –   Linux Journal,
   –   Yggdrasil Computing, Inc.,
   –   Linux International
   –   Work Group Solutions
       (Digital Equipment Corporation & Red Hat Software contributed
       to the cost of the legal process)
  to re-assign the Linux trademark to Linus Torvalds.
  The firm of Davis & Schroeder handled the case on
  an almost pro-bono basis. (Freeor reduced charge
  for public good)
• Kool Desktop Environment (KDE) project
  announced.
A Brief History of Linux
1997:
• The Linux trademark dispute between William
  Della Croce and Linus Torvalds is settled, with
  Della Croce
  re-assigning the trademark to Torvalds.
• Miguel de Icaza starts the GNOME project.

1998:
• Version 1.0 of the K Desktop Environment (KDE)
  released.
A Brief History of Linux
1999:

• Linux kernel version 2.2 released.
• GNOME 1.0 desktop released.

2000:
• Microsoft CEO Steve Ballmer calls Linux "a cancer
  that attaches itself in an intellectual property
  sense to everything it touches." in an interview
  with the Chicago Sun-Times.
A Brief History of Linux
2001:
• Linux kernel version 2.4 released.
2003:
• Linux kernel version 2.6 is released.
• Novell acquires German Linux distributor SuSE.
• Red Hat announces that they will no longer sell
  boxed sets of their Linux distribution for retail
  customers. Instead, they will distribute Linux to
  end users via a development distribution called
  Fedora Core.
 Multi-user:

  • Each user’s shells, applications and commands are
    separate processes
  • Number of simultaneous users limited only by:
      – CPU speed and available memory
      – Min. response times required by users/apps

 Multi-tasking:

  • Many jobs can be under way at the same time
  • Jobs truly simultaneous on multi-cpu

   Time-sharing:

  •   A single cpu is shared by all processes
  •   Processes exec briefly, passing cpu to others
  •   Process switches occur in miliseconds or less
  •   Kernel gives process a sense of total control
Applications of Linux
AS the Linux is the OS, it provides lot of
applications. Some of them given below:
1)Text And Word Processing Applications
       Star Office is Text and word application
instead of          WordPad and notepad.
2) Programming Language
       There is a wide verity of Programming and
scripting languages and tools available for Linux.
3)X-windows
       X-windows is a highly flexible and
configurable GUI environment that run on Linux as
well as almost UNIX System.
Applications of Linux
4) Internet tool
       It supports Netscape as well as Mosaic
       It provides wide and full range of software needed
to create internet server.
       It also provide the complete network support to
connect the internet.
5) Data bases
       Today Oracle, Sybase and Informix all offer
relational data base provides for Linux.
6) Dos and Windows Capability Software
      Linux can be made to run DOS software with high
degree of stability and compatibility.
Acquiring and using Linux
  There are quite a few ways to obtain a Linux distribution.
1. One way is to go to the distributor's website and
   download the linux distribution of our choice.

  For example,
  If you want to download

  a. Mandrake, the go to http://www.mandriva.com/.

  b. SUSE Linux Enterprise Server 9,
  go to
  http://www.novell.com/linux/download_linux.html.
Acquiring and using Linux
2. Other way is to obtain pre-burned copies of
  the Linux distribution we need from the
  distributor’s website or from sites like
  cheapISO.com
  – The price is of such distributions starts from less than Rs.
    100/-
  – Some new computers have Linux as preinstalled
Examining Linux Distributions


• A Linux distribution is a collection of software
  that incorporates a version of the Linux kernel,
  versions of the assorted GNU tools, and various
  other bits and pieces like XFree86, the Open
  Source version of the X-windows system.
• Many vendors of distributions offer this
  collection as a basic version, and charge (extra)
  money for versions that incorporate or include
  various non-free programs.
Survey of Major Distributions
• The major distributions of Linux include:

  –   Caldera
  –   Debian
  –   Mandrake
  –   Red Hat
  –   Slackware
  –   SuSE
  –   Turbolinux
Linux distributions.            Website/Logo

Red Hat Linux: http://www.redhat.com/



 SuSE Linux: http://www.suse.com/


           Mandrake Linux:
   http://www.mandrakesoft.com/

            Caldera Linux:
   http://www.calderasystems.com/


         Debian GNU/Linux:
       http://www.debian.org/


           Slackware Linux:
     http://www.slackware.com/
X-WINDOWS

• X-Windows is GUI for UNIX          Which sets up the graphics display
• X-Windows is a highly configurable environment that
                                       (resolution , refresh rate, color
                                      depth),displays the windows and
     provides a broad range of flexibletrack mouse movements , key
                                         operation for both
                                                   strokes
     the user and application developers.
• On X-Windows system two application must run to
     provide the complete GUI 1) X-server
It provides menu, windows border, 2) window manager
mechanism for moving ,switching,
minimizing or maximizing windows.
Components of the
               X Window System
•   X server
•   X client
•   Window manager
•   Graphical libraries
•   Graphical application
    – Provides a comprehensive user interface
Components of the
X Window System (continued)
Starting X
• $ startx
  – Standard command to start X window system


  H.W
  Similarities and differences between X-windows and
  Microsoft windows
Desktop Interfaces
• Graphical environment
  – Provides collection of functions and utilities
  – Makes using computer easier for those who do
    not have many commands memorized
• KDE interface
  – Most widely used desktop environment on Linux
    systems
  – Installed by default for most distributions, except
    Red Hat
Desktop Interfaces (continued)
• KDE interface includes suite of applications
  – Internet access
  – System maintenance
  – Personal productivity
  – Other basic tasks
• Panel
  – Set of icons at bottom of screen
Desktop Interfaces (continued)
• GNOME desktop
  – Stands for GNU object model environment
  – Very similar to KDE
  – Includes panel with integrated taskbar
  – Applications included similar to those with KDE
  – Installed by default for Red Hat
Working with Graphical
 Windows (continued)
Configuring GNOME and KDE
• GNOME and KDE
  – Both highly configurable
Questions !!!
Unit -2
System Access
Logging In and using the Linux system


Linux Commands


Logging In and using Remote Linux
system
2.1 Logging in and Using Linux System

      Because the system can be used by many users some
   has to be given charge of administration of the system
called ‘system administrator’ who will grant you the authority
to use the system .
login: kumar
Password:*******
This will start up a desktop. The default desktop in RedHat Linux 9 is
GNOME desktop.
        If you want to turn off your computer, you must first shut down
Linux. You can shut down your system in three ways:
1)By using halt command.                          Main Menu
2)By using shutdown command.
                                                  Logout menu
#halt
This command will log you out and shut down
the system.
•$ halt


# shutdown
shutdown 16:00        shut down at 16:00
shutdown -r now       shutdown immediately and reboot
shutdown -h now       shutdown immediately and halt


  Linux also allow alt+ctrl+del
Saving Your Configuration Between
                Logins
• On logout
  – GNOME can note which application windows were
    open
  – Same applications are opened automatically at
    next login
• Can also save configuration between logins
Configuring the Graphical
              Login Screen
• Before you are permitted to configure most
  parts of graphical login screen
  – Must be logged in as root or enter root password
• Select system settings, then Login Screen on
  GNOME main menu
  – Or runrun gdmsetup command
• Configure login options
Basic Commands
How to run commands
• Finder => Application => Utilitaires => Terminal
• When you log on Unix machine, you will see,

[someone]$

• One command consists of three parts, i.e.
  command name, options, arguments.

Example)
[someone~]$ command-name optionA optionB
   argument1 argument2
Basic Commands
How to run commands
• Between command name, options and
  arguments, space is necessary.

• Options always start with “-”

• Example:
  cd ..
  ls –l .bashrc
  mv fileA fileB
Some more Linux commands
                                             Everything in the
                                             square bracket is
Name                   Syntax                optional

• Cal                  • Cal [ [ month ] year ]
                       • E.g. $ cal
                     Current date
                      Current date
                     Wed augcal 3 1985
                       •   $ 31
                      Wed aug31
                     16:22:40 IST
                      16:22:40 IST
                         2005
                          2005    Month no
                                  Month no
• Date                •   $ date    08
                                     08
                                    Month name
                                     Month name
                                         Month no with
                      •   $ date +%m Aug name with
                                           Month no
                                         Aug
                                               name
                      •   $ date +%h         08 Aug
                                              08 Aug

                      • $ date +”%m %h”
To display the a: bell
                            To display the
                           message on the backspace
                           message onb:the
• $ echo                                    • $ printf
                               screen c:current line
                                screen
• Syntax: echo Linux                  n :•new line printf Linux
                                              Syntax:
                                          t tab
  $ echo [-ne] [string]
  -e: enables the interpretation of back slash special character in
  string.
  -n: disable o/p of trailing new line


  Who: The o/p of this command is linux gives us a
  details of the user who have logged the linux system
  currently
  e.g. $ who
  o/p: student tty10 july 30 7:14



                      Terminal name
clear : Clears the terminal screen and resets the prompt and cursor
location to the first line of the screen.
$ clear
.


Free: Displays a report of free and used memory.
Free [-b|-k|-m][-s delay][-t]

-b: Displays amount of memory in bytes.
-k: Displays amount of memory in kilobytes(this is default).[$ free]
-m: Displays amount of memory in megabytes.
-s delay : Displays continue reports separated by specified delaying seconds[^z
to escape it]
-t: Displays an extra line containing totals.
kill: You can terminate process with kill command. The command uses
one or more PID’s as its argument.

$ kill 122 129 115


sleep: This command will suspend the execution of shell.
The maximum limit of sleep is 18000 second.
Unfortunately keep the terminal idle.

$ sleep [seconds]


ps: This command will displayed the process status .submmission time
,required CPU time, Process name.

$ ps [option]

-a: Print all terminal process.
-e: Print all current process.
-t: Print all processes of listed terminal.
-u: Displays processes of listed user.
Basic Commands
1.Jumping directly to the line.
    Commands
2. Jumping directly beginning and ending of
the file.
3. Move backward through the file.
    • ls                        show files in current position
4. Search backward through the file.

  •    pwd           show current position

  •    cd                      change directory
  •    less, more              display file contents
  •    man xman                display online manual(help pages)
  •    find ,grep              For searching for a file.GREP.docx
  •    su                      switch user
  •   cat                      For i/p and o/p on the screen
  •   wc                       count word char and no.of line in a
                               given file

                    Basic command1
                    Basic Command2
Basic Commands
Commands This command we will see in next unit.
•   passwd            change password
•   useradd           create new user account
•   userdel           delete user account
•   mount             mount file system
•   umount            unmount file system
•   df                show disk space usage
•   cp                copy file or directory
•   mv                move file or directory
•   rm                remove file or directory
•   mkdir             create directory
•   rmdir             remove directory
Relative & Absolute Path
• Path means a position in the directory
  tree.
• To express a path, you can use relative
  path or absolute path.
• In relative path expression, the path is
  not defined uniquely, depends on your
  current path.
• In absolute path expression, the path is
  defined uniquely, does not depend on
  your current path.
Relative & Absolute Path
• Relative Path   Ablsoute Path
  pwd             cd
  cd .            mkdir mydir
  pwd
                  pwd
  cd ..
  pwd             cd /Users/invite
  cd ..           pwd
  pwd             cd /Users
  cd              pwd
                  cd /
                  pwd
                  cd /Users/invite
                  cd ~/mydir
User Accounts
 Creating additional user accounts
                                                              This creates the
 Useradd- $ useradd user1                                       user with all
                                                               default setting

1)    Creating a entry of user in /etc/passwd file with password
2)    Assigning a user ID to user .it is greater than all other user ID.
3)    Adding user to appropriate group.
4)    Creating a home directory for the user.
$ useradd –u 500 user1
                                                $ useradd –g group-name user1
     1) If you want to use particular user ID.
     2) If you want to assign a particular group to user.
     3) If you want to specify an alternative home directory for a
        user.
                                $ useradd –d directory-name user1
usermod: Modifying the user
          usermod is used for , modifying some of the parameters
  set with useradd.
         e.g. usermod –s /bin/bash oracle




*We can combine all the option in this way.
   The useradd command adds new user to the system.

  $ useradd –u 210 –g dba –d /home/oracle –s /bin/ksh oracle
Managing user accounts

Change Password             o/p:
                            old passwd:
$ passwd
                            New passwd:
                            New passwd:

                      Deletes the
 Removing user           user
                       Deletes the user
 $ userdel user1          and its file
 $ userdel –r user1
Creating Group

Creating Group

$ groupadd [option] group-name

1) -F : If the group is already available then it should display
result.
2) –g : Group ID is suppiled by this action.
3) –o : giving ID which is not unique.
4) –r : Add to system account..


Deleting Group

$ groupdel group-name
Adding user to Group


  •   There is no standard program available to add the user to a group
  •   In order to do this we can directly edit the file /etc/group.

      Group-name :: password : group-id : user-list




Name of      Encrypted password to   Unique Group ID in      Comma
Group        the group               numeric form            seperated
                                                             user list who
                                                             want to add
                                                             this group
Modifying Group
     If you want to change a group name you
can use the groupmod command.
e.g change the group’s name from test1 to
test2

 # groupmod –n test2 test1
Managing Users:

           For the creation and maintenanace of user accounts,
     Linux provides 3 commands :useradd,usermod,userdel


     useradd : Adding user

      The useradd command adds new user to the system.

     $ useradd –u 210 –g dba –d /home/oracle –s /bin/ksh oracle

jh
This quietly creates the user oracle with a UID of 210 and name dba.The
home directory is /home/oracle, and user will use the Korn shell. The –
option ensures that the home directory is created if it doesn't already exist
and copies a sample .profile and .kshrc to the user’s home directory.
•   usermod: Modifying the user
        usermod is used for , modifying some of the parameters of already
    existing users.
       e.g. usermod –s /bin/bash oracle



•   userdel : Removing user
            Users are removed from the system with userdel.
           userdel oracle
Unit -3
   Introduction to File System And
          Linux Permission
Managing File.
Managing Directory.
Understanding permission.
Evaluating System Security.
File contains 3 types of information




 User data   System data     Executable file


File Name
1)File name is upto 256 character.
2)This character can be a lower case ,upper case,numbers
and other character like hypen(-), under scroll(_) and
period(.)
3)Don’t include Meta character because they have special
meaning(*,?,&,/ etc)
Standard directory structure
◮ / - the topmost
◮ /dev - all the devices are accessible as files
◮ /var - “variable” data such as mails, log files,
databases
◮ /usr - almost all the packages installed
◮ /etc - configuration files
◮ /home - home directories for all the users
◮ /root - home directory of the privileged user root
◮ /mnt - used to mount other directories/partitions
File Navigation
1) Navigating using GUI
2) Navigating using terminal

Navigating using GUI
    Main menu


         Home folder


         Nautilus file manager

You can give any address to this location
bar and nautilus will displayed the contents at
that location
In this way you can navigate up to root
directory
Navigate using terminal                     •   Open terminal

                                                    •   Type the command


1) pwd: It gives present working directory
   $ pwd

2) ls: It displays the list of file and directory
    $ ls [option]

3) cd: Change directory
    $ cd dir-name

4) For searching file.



Locate command                 Find command
$ locate file-name             $ find start-dir parameter action
Managing File system
•   Creating a file
•   Deleting a File
•   Copy a File
•   Move a file
•   Archiving a File
•   File Compression
    Creation of a File:
          cat is used for creation of file. Enter command cat followed by the >
    character and file name.

     $ cat
     $ cat > fileName1
     $ cat fileName1
     $ cat >> fileName1
     $ cat > fileName2
     $ cat fileName1 fileName2
     $ cat fileName1 fileName2 > fileName3
Copying A File :
•   The cp command copies a file or a group of files.
•   It creates an exact image of a files on disk with different name.
•    The syntax requires at least 2 files names to be specified in the
    command line.
•   When both are ordinary files the first is copied to other.
•    If the destination file (unit1) doesn’t exist it will first be crated before
    copying takes place.
•    If already exist it will simply overwritten without any warning from the
    system.
e.g $ cp file1 file2
      $ cp file1 /temp
                                                        Copy multiple file
      $ cp file1 /temp/file2
                                              Copies all directories and sub
      $ cp file1 file2 file3 /tem/file4
                                                        directories.
      $ cp *.txt *.doc *.bak /tem/file
 Deleting file:

     The rm command deletes one or more files.

$ rm file1
$ rm file1 file2 file3
$ rm *.txt
.

   Renaming Files:
        The mv command renames (moves) file .It has 2 distinct functions.
          1) It renames a file (or dir).
          2) It moves a group of file or different directory.
 mv doesn’t create a copy of the file only renames it. No additional space is
consumed on disk during renaming.

$ mv file1 /tmp
$ mv file1 /tmp/file2
$ mv *.txt , *.doc,*.bak /tmp
Locating the File System


              Using GUI          Using command
                                       line


Main Menu
                                    1) Use locate command               All files wit
                                                                         the given
File Option                                 $ locate FileName            extension

                                    2) There are various option like-
Specify Name of file which
you want to search(In                       i) $ locate *.extension
Dialogue Box)
                                            ii) $locate –i fileName

Click on file (we get location
of the file in the box)
Making Directory


 To create a new directory use the mkdir command
 ,the syntax is:

 $ mkdir DirName


Deleting Directory


  To delete whole directory use –r flag with rm
                   command .
             e.g. $ rm –r DirName
File Ownership and permission
 In Linux each file is owned by that user who created it. The owner of
   the file has the right to read the file, run it, delete it.
 Each file and directory in Linux contains set of permission that
   determine who access them and how.
 Other user can do only those things for which the owner has given
   the permission.
 A file also belongs to a group.
 Each user on the system is a memberof one or more group.
                                         Date of             Name of
                    Access
 To see the file ownership details creation
                                        use                    file
$ ls –l           Permission
Total 866
-rw –r – 1 root root 2045 oct 23 1997 Dir-colors


        File
       Owner         File Group          Size
                                        of file
 To change owner of file
$ chown user-name filename
$ chown u1 f1

 To change a group of file
$ chgrp group-name filename
$ chgrp g1 f1
Access permission for a file is divided into three:

  1)File owner(denoted by u)
  2)Members of a file group(g)
  3)Others(o)              Others
                         Permission
  e.g. rwx rwx rwx
                             (o)
Owner
 user
  (u)        Group                    1) r: Indicate the read permission.
           permission
                                      2) w: Indicate the write permission
               (g)
                                      3) x: Indicate execute permission
                                      4) -: Indicate that particular
                                      permission is denied.
To change the access permission of a file/directory.
$ chmod <mode> file-name


   +                    -              In this mode we can change all
              To                   permission at one time using 3 sets of
          grant/revok                           3 binary digits.
             e the                         e.g.$ chmod 755 mydata
          permission               This command allows the user to read
                                    write and execute while it allows the
                                   group and others to read and execute
                                                     only.
Symbolic Mode      Absolute Mode

             (u):User Owner
               (g):for group
            (o): for other user
• Chmod u+r file-name: gives owner to read
  the permission

• Chmod g-x file-name: takes away to execute
  the permission from group

• Chmode o+rx-w file-name: allow others to
  read and execute but not to write permission
Unit -4
     Creating And Viewing the File
                 And
           Archiving the File.
Using Vi editor and other editor.
Examine file content,redirection.
Archiving the file with tar and cpio.
Zipping file .
There are various editors as follows:


1)   Vi editor
2)   Vim editor
                    Link 1
3)   Emac editor    Link 2
4)   Ed editor      Link 3
5)   Joe editor
6)   Red editor




                                        GO
Vi editor
 It is a full screen text editor that enables you to view ,to create and edit
  a file several lines at a time .
 Most Unix system ,including Linux come with Vi. Vi works with buffer
  as Vi edits the file ,read a file into buffer and enables you to change the
  text in buffer .
 Before you start a full screen text editor such as Vi you must set the
  TERM environment use the terminal type of lookup the terminal
  characteristic in the etctermcap file and then control the terminal in
  the full screen mode.


  Vim editor
 This is a enhance version of Vi editor .
 It includes various enhancement over the Vi editor such as syntax
  highlighting, command line editing and online help .
 The Vim editor can be used to edit as ASCII text, it is specially useful
  for editing the programs.
                                                               Back
emac editor
 “the edit macro ” or emac editors is the next widely used editors.
    It provides the larger set of commands than Vi editors.
   The editors is used to format source code for programming
    languages such as C and C++.
   It allows to work with multiple file at a time .
   Emac editor offer ispell utility to check the spelling in the
    document.
   It also offers the online help.


ed editor
  To use the line editor or ed to creates display , modify, save text
   files.
  When you start ed editor with file name as an argument, a copy of a
   file is created in the editor buffer. You can make changes only to
   the copy of a file and not directly to the file.
  To save the changes to the file you use w command.
                                                                Back
Joe editor
 You can invoke the Joe editor by typing at the command prompt.
 The Joe editor is a full screen editor that lets you edit both programs and
  text.


  red editor
 You can use the restricted editor or red editor
 To edit the file in the current directory you can not execute shell
  commands by using the red editor.




                                                               Back
 Archiving Files:

Tar
 Specifies that you are
 creating an archive as used to create archive known as tar archive.
    This command is
opposed to viewing an
   This command create new archive with new file name.
     existing archive
 Tar file has .tar extension.
Copy a file into archive the file into archive so there is no danger that
   This process copies
   original file will be deleted in process.
Syntax:
$ tar cvf tar file-name file_list

                                  Means you are
                               archiving in a file as
                              opposed to temp drive
                               f represents the file.
      Indicate that each
    command should be
    verbose mode. which
     means that each file
   name will be displayed
      as it is copied into
             archive.
e.g.1) $ tar cvf text.tar *.txt
       It copies all .txt file and create archive file
with the name text.tar

    2) $ tar cvf vnc.tar vnc
       It copies all contents of vnc directory.

 To view the contents of archive file replace c by t
.
 e.g. $tar tvf vnc.tar

 To extract contents of an archive into current
  directory replace c by x

 e.g. $ tar xvf vnc.tar
Other Option of the tar command
•-r : To append the file to an archive . That means archive can contain
several file with same name.

•-u : It also add the file to an archive but only if the file is not already
there or if file is there then overwrites it.

•-w : It permits interactive coping and restoration. It prints the file
name and prompts for the action to be taken (Y /N)
Create Compression
A compressed archive is a single file that contains
one or more file in a compressed form.
Every Linux system comes with all or some of the
following compression and decompression utilities.
• gzip and gunzip (.gz)
• bzip2 and bunzip2(.bz2)
• Zip and unzip (.zip)
Gzip
• While tar is useful for archiving the file, it doesn’t
  perform any compression.
• It is done with the gzip command
• It adds .gz extension to the end of the file.
• It compressed individual file but not create archive.
• It saves the memory.

E.G. $ gzip text.pdf
o/p: It creates the compressed file with the name
  text.pdf.gz
     $ gzip *
o/p: It compressed all files in the current directory but
  not in sub directory.
      $ gzip –r *
o/p: It compressed all files in the current directory and
  also in sub directory.
To uncompressed the file

  $ gzip –d text.pdf.gz

 Alternative to –d option(gunzip)

 $ gunzip text.pdf.gz


To view the compressed text file, no need to decompressed

$ gzcat text.pdf.gz        or

$ gzmore text.pdf.gz

Combining gzip and tar                         alternative

$ tar cvf text.tar *.txt
$ gzip text.tar
It creates single compressed archive of all .txt file with the name
text.tar.gz
Bzip2 and bunzip2

•Its working and functionality is same as gzip and gunzip resp.
•If you know gzip and gunzip then you also know the bzip2 and
bunzip2.
•Bzip2 is slower than gzip and creates .bz2 files.
Zip and unzip

•Compressing and archiving together.
•Zip requires first argument to be compressed file name, the renaming
arguments are interpreted as files and directories are to be
compressed.                       It compressed the t1.html and
•The unusual features of this command is thatthe doesn’t overwrite an
                                     t2.txt and make it single
existing compressed file. If it isarchive with the name text.zip be updated
                                   already exists ,file either
or appended to the archive .                 It compressed all files in current
                                                directory but not in sub
                                             directory and make the single
e.g. $ zip text.zip t1.html t2.txt          archive with the name text.zip
                                         It compressed all files in current
     $ zip text.zip *
                                              directory and also in sub
     $ zip –r text.zip *                   directory and make the single
                                          archive with the name text.zip
To Unzip the file
                                        It decompressed all files and
    $ unzip text.zip                   come all the files in the original
                                                     form
Archiving File with cpio (copy input output)

•The cpio command copies the file to and from a backup
devices.
•It uses standard input to take the list of file names.
•It then copies them with their contents and headers to the
standard output which can be redirected to the file and device.
•This means that cpio can be used with redirection and piping
•Cpio uses two key option

i)–o (output)
ii)-I (input)

    Either of which but not the both must be there in
command line.
Backup files (-o)
•Since cpio uses only standard input you can use ls to generate
list of file name to serve as its input.

•The –o key option creates the archive on the standard output
,which you need to redirect to a device file.

•This is how you copy the file in the current directory to a 1.44mb
floppy.
•$ ls | cpio –ov > /dev/rdsk/f0q18dt or

•$ ls | cpio –o > /dev/rdsk/f0q18dt

•$ find / -name “f*” –print | cpio –o > / dev/rdsk/f0q18dt
Restoring Files (-i)

•A complete archive or selected files can be restored with the –
(i) key option .

•To restore the files use the redirection to take input from the
device.

•$ cpio –iv < /dev/rdsk/foq18

•Cpio also accepts a quoted wild cards pattern so multiple files
fitting the pattern can be restored.

•$ cpio –I “*.sh” < /dev/rdsk/f0q18
Displaying the archive (-it)

 •The –t option displays the content of the device without restoring
 the files.
 •These option must be combine with the (-i) key option

 •$ cpio –itv < /dev/rdsk/foq18

Other Option

•-r : It renames the file before starting the coping process . The
system presents each file name and waits for a response .If you enter
the file name coping is done with that file.
•A null response leaves the file uncopied.

•-f : This option followed by the expression causes cpio to select all
files except those in the expression
         $ cpio –ivf “*.c” < /dev/rdsk/foq18
•It restores all files except C program.
Dump and restore utility

•You can use the dump utility to back up the file from file system
•Typically it is used for back up the data not for archiving
•The restore utility performs the inverse function of the dump utility

e.g.1) $ dump <back up level> [option] file system

    2) $ Restore <operation> [option] files
What is shell?
The shell is a program used to interface between you and the linux.


                          User



                 Linux Shell Program




                     Linux Kernel
How the shell get’s started?
Generally the ‘bash’ is the most popular and default shell.
In X-windows you can start a shell by running terminal window (such as x-
term)

  The most Common Shell

 •   Sh (Bourne shell)
 •   C shell
 •   Ksh (Korn shell)
 •   Bash (Bourne Again Shell)
Features Of Bash                      $ cd t<tab><enter>
1)Command Line Completion
2)Wild cards            There are 3 types of wild cards
3)Command history1)* : Matches any character and any no of character
4)Aliases        2)? : Matches any single character
                      3)[…] : Matches any single character content within the
                      braces.


                      • HISTSIZE
                      • .bash_history


                  $ cd /user /x11/Lib/x11/FVWM/sample-config
         $ alias gosample=‘cd /user /x11/Lib/x11/FVWM/sample-config’
                                  $ cd gosample
                                $ unalias gosample
Redirection Symbol

  •Input Redirection(<)
  •Output Redirection(>)
  •Output Redirection with append mode(>>)




Pipeline

Output from first command in the pipeline is used as the
input to the second command in the pipeline
e.g.
$ cat sample.txt | grep “high” | wc -l
Prompts

•First level ($)
•Second level (>)



Ps1=“Please enter the command”
Ps2=“I need more information”
Surprise Test 1
UNIT V
Working in X Windows
X Windows (X11)

• History of X
  – Developed at MIT in 1984

  – Derived from Stanford project called W

  – X is now freely distributable, and available for
    UNIX, Windows, and Mac.
• The X Windows system is the standard graphical
  interface for UNIX

  – Distinguishing features:
  – Allows multiple virtual terminals to be opened at
    once
  – Highly Customizable and extensible
  – Highly Portable
  – Works over networks
X Windows Architecture

•   Separation of display and programs
•   Connected by TCP/IP
•   Your display is the X server
•   Programs that run are clients
•   Confusing because backwards from what we
    are used to.
• It is important to note that X is a network-oriented
  graphics system.
• That is, X clients can run either locally (on the same
  system that the server is running) or remotely (on a
  system somewhere on a TCP/IP network).
• The X server listens to both local and remote
  network sockets for requests from clients. This
  feature is obviously quite powerful. If you have a
  connection to a TCP/IP network, you can log in to
  another system over the network and run an X
  application there, directing it to display on your local
  X server.
• From the beginning it incorporated many of the
  windowing capabilities that we now take for
  granted.



• These capabilities include network transparency,
  graphical capability, the use of a mouse, and the
  ability to link together a heterogeneous network
  of workstations from different vendors .
• One of the most significant features of X is
  that it was specifically designed to work across
  a network.
• The client and the server communicate via the
  X Protocol, a network protocol that can run
  locally or across a network. Regardless of
  whether a client program is local or remote, it
  communicates with the server through the X
  Protocol.
Managing Files and File systems
Types Of      Description
File System
Ext           Earlier version of Linux File System ,no longer in use

Ext2          Older standard Linux file system

Ext3          standard Linux file system

Msdos         File system for MSDOS

Ntfs          File system for Windows NT ,Windows XP ,windows 2000

Iso9660       File system for mounting the CDROM

Fd0           Mounting the file system to the floppy drive.
Managing Files and File systems

• Under Linux, filesystem types include the Second
  Extended filesystem, or ext2fs, which you probably
  use to store Linux files.

• when you access any file system under Linux, the
  system presents the data as files arranged into a
  hierarchy of directories, along with owner and group
  IDs, permissions bits, and the other characteristics
  you're familiar with.
• Information on file ownership, permissions,
  and so forth is provided only by file system
  types that are meant to be used for storing
  Linux files.

• As the system administrator, you need to
  know how to create file systems should you
  want to store Linux files on a floppy or add
  additional file systems to your hard drives.
• Mounting Filesystems:
  In order to access any filesystem under Linux,
   you must mount it on a certain directory. This
   makes the files on the filesystem appear as
   though they reside in the given directory,
   allowing you to access them.
 The mount command is used to do this and
   usually must be executed as root.
 Syntax:
mount -t type device mount-point
• where type is the type name of the filesystem

• device is the physical device where the filesystem
  resides (the device file in /dev)

• mount-point is the directory on which to mount the
  filesystem.

• For example, if you have a Second Extended
  filesystem on the partition /dev/hda2, and wish to
  mount it on the directory /mnt, use the command:

 mount -t ext2 /dev/hda2 /mnt
• To mount a floppy that was created on a Windows
  system and therefore is in DOS format, you use the
  command:
  mount -t msdos /dev/fd0 /mnt

• This makes the files available on an MS-DOS format
  floppy under /mnt.

• The inverse of mounting a file system is, naturally,
  unmounting it.
• Unmounting a file system has two effects: it
  synchronizes the system's buffers with the actual
  contents of the file system on disk, and it makes the
  file system no longer available from its mount point.
  You are then free to mount another file system on
  that mount point.
• Unmounting is done with the umount
   command (note that the first "n" is missing
   from the word "unmount"), as in:
  umount /dev/fd0
  to unmount the filesystem on /dev/fd0.
• Similarly, to unmount whatever filesystem is
   currently mounted on a particular directory,
   use a command such as: umount /mnt
Creating File systems
• A filesystem can be created using the mkfs command.
  Creating a filesystem is analogous to "formatting" a partition
  or floppy, allowing it to store files.
• Syntax:
 mkfs -t type device blocks
  where
  type is the type of filesystem to create,
  device is the device on which to create the filesystem (such as
  /dev/fd0 for a floppy),
 blocks is the size of the filesystem,
• For example, to create an ext2 filesystem on a
  floppy, you use this command:
  mkfs -t ext2 /dev/fd0 1440
• Here, blocks is 1440, which specifies a 1.44-
  MB, high-density 3.5-inch floppy. You could
  create an MS-DOS floppy using -t msdos
  instead.
Checking and Repairing File systems
• It is sometimes necessary to check your Linux file
  systems for consistency and repair them if there are
  any errors or lost data. Such errors commonly result
  from a system crash or loss of power.
• The program fsck is used to check file systems and
  correct any problems. Like mkfs, fsck is a front end
  for a file system-type-specific fsck.type, such as
  fsck.ext2 for Second Extended file systems.
• Syntax:
• fsck -t type device
• For example, to check an ext2 filesystem on
  /dev/hda2, you use:
• fsck -t ext2 /dev/hda2
Customizing X Environment
Xinit
 – You run X with the startx command.
 – This is a front end for xinit, the program
   responsible for starting the X server and running
   various X clients that you specify.
 – xinit (via startx) executes the shell script .xinitrc in
   your home directory.
 – This script simply contains commands that you
   wish to run when starting X, such as xterm, xclock,
   and so on.
 – If you don't have a .xinitrc file, the system
   default /usr/lib/X11/xinit/xinitrc is used instead of
   that.
Running startx with this particular .xinitrc in place gives you something
that looks like
Configuring X-Windows
• Configuration of X11 is a multi-step process.
  – # Xorg –configure
  – This will generate an X11 configuration skeleton
    file in the /root directory called xorg.conf.new.
    The X11 program will attempt to search the
    graphics hardware on the system and write a
    configuration file to load the proper drivers for
    the detected hardware on the target system.
• # Xorg -config xorg.conf.new
   – Test the existing configuration to verify that Xorg can
     work with the graphics hardware on the target
     system.
• # Xorg -config xorg.conf.new -retro
   – this test produces a black screen which may make it
      difficult to diagnose whether X11 is working properly.
      The older behavior is still available by using the retro
      option.
• If a black and grey grid and an X mouse cursor appear,
  the configuration was successful. To exit the test, switch
  to the virtual console used to start it by pressing
  Ctrl+Alt+Fn (F1 for the first virtual console) and press
  Ctrl+C.
GNOME
• The GNU Network Object Model Environment
  also known as GNOME.
• It consist of Panel, desktop, set of GUI tool
• GNOME is provided a flexible platform for the
  development of powerful application
• GNOME is strongly supported by several
  distribution and is the primary interface for
  red hat and mandrake.
Advantages Of GNOME
• It is open source software , it is available free of cost.
• GNOME supports the drag and drop feature.
• GNOME documentation is extensive and you can
  view the document by using the GNOME help
  browser or any web browser such as Netscape
  Navigator.
• GNOME support many national languages and you
  can add new language without making any additional
  changes to the s/w.
Choosing And Changing Window
       Manager And Desktop
• GNOME works with any window manager.
• However desktop functionality such as drag and drop
  capabilities and the GNOME pager only work with window
  manager that are GNOME compliant.
• The current release of GNOME uses the sawfish window
  manager.
• If you have several window manager installed on your system
  you can change from one to other using the window manager
  caplet.
• Caplet is the term used for a control panel , a module used to
  configure your desktop.
• select the window manager entry in main menu to start a
  setting menu or select its icon in the desktop.
Continued….
•Windows opened from perform preferences in the start here
window. A Panel is displayed listing your window managers.
•To add others to the list click on Add button on the right side of
the panel.
•This open the window that prompts you to enter an identifying
name for the window managers the command that starts the
window managers and any configuration tool it may used.
•If the window manager is GNOME compliant you can click the
button window manager Is session Managed.
•Once you finished making your entries and click OK the new
window manager appears in the list on the window manager
panel select it and click.
•Try to run that window manager. To run window manager
configuration tool, click run configuration tool button.
Remote X window access

While running X on the system the X servers run on the
computer and controls the monitor keyboard and mouse.
The server responds to command that X client sends that
open window and draw in those window.
The X client may run locally or on the remote system. The
argument is called as client server model.
 A server provides the source that the client request.
Client communicate with server through network.
X display server offered graphics display server to client
that send X-protocol request to the server .
File servers and database servers request are usually
process executing on remote machine.
.
Continued…

The X client may run on locally or remote system with the
name of script file as a parameter first.
This should work but it would be much better if we could
simply revoke the script by typing its name giving it the
respectability of the linux command.
We do this by changing the file , make a file executable for
all user using the mode cmd $ chmod +x first .
Chmod to make a file executable use man and chmod to
find out more about octal arguments and other option

Más contenido relacionado

La actualidad más candente (20)

Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Presentation on linux
Presentation on linuxPresentation on linux
Presentation on linux
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
Linux
LinuxLinux
Linux
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Linux operating system - Overview
Linux operating system - OverviewLinux operating system - Overview
Linux operating system - Overview
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
UNIX Operating System ppt
UNIX Operating System pptUNIX Operating System ppt
UNIX Operating System ppt
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Linux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating SystemLinux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating System
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUX
 
Ubuntu – Linux Useful Commands
Ubuntu – Linux Useful CommandsUbuntu – Linux Useful Commands
Ubuntu – Linux Useful Commands
 

Destacado

Chapter 21 - The Linux System
Chapter 21 - The Linux SystemChapter 21 - The Linux System
Chapter 21 - The Linux SystemWayne Jones Jnr
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt onu9
 
History Of Linux
History Of LinuxHistory Of Linux
History Of Linuxanand09
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linuxanandvaidya
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash scriptSimon Su
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpen Gurukul
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 
Let us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionLet us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionrohit kumar
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine LearningRahul Jain
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017LinkedIn
 

Destacado (16)

Chapter 21 - The Linux System
Chapter 21 - The Linux SystemChapter 21 - The Linux System
Chapter 21 - The Linux System
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic web dev
Basic web devBasic web dev
Basic web dev
 
Linux S.O
Linux S.OLinux S.O
Linux S.O
 
History Of Linux
History Of LinuxHistory Of Linux
History Of Linux
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Let us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionLet us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solution
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017
 

Similar a Linux command ppt

introductiontolinuxpptbatch2-141025005514-conversion-gate01 (1).pdf
introductiontolinuxpptbatch2-141025005514-conversion-gate01 (1).pdfintroductiontolinuxpptbatch2-141025005514-conversion-gate01 (1).pdf
introductiontolinuxpptbatch2-141025005514-conversion-gate01 (1).pdfEidTahir
 
Linux basics
Linux basicsLinux basics
Linux basicsNAILBITER
 
Introduction and history of linux
Introduction and history of linuxIntroduction and history of linux
Introduction and history of linuxSHUBHA CHATURVEDI
 
Chapter 8 - nsa Introduction to Linux.ppt
Chapter 8 -  nsa Introduction to Linux.pptChapter 8 -  nsa Introduction to Linux.ppt
Chapter 8 - nsa Introduction to Linux.pptgadisaAdamu
 
1 Intro, Linux system Architecture, Features, File system Structure and appli...
1 Intro, Linux system Architecture, Features, File system Structure and appli...1 Intro, Linux system Architecture, Features, File system Structure and appli...
1 Intro, Linux system Architecture, Features, File system Structure and appli...PAVAN KUMAR ILLA
 
Linux Operating System. UOG MARGHAZAR Campus
 Linux Operating System. UOG MARGHAZAR Campus Linux Operating System. UOG MARGHAZAR Campus
Linux Operating System. UOG MARGHAZAR CampusSYEDASADALI38
 
Course 101: Lecture 5: Linux & GNU
Course 101: Lecture 5: Linux & GNU Course 101: Lecture 5: Linux & GNU
Course 101: Lecture 5: Linux & GNU Ahmed El-Arabawy
 
Linux programming lecture_notes
Linux programming lecture_notesLinux programming lecture_notes
Linux programming lecture_notesIMRAN KHAN
 
Basics you should know about UNIX and LINUX
Basics you should know about UNIX and LINUXBasics you should know about UNIX and LINUX
Basics you should know about UNIX and LINUXNemwos
 
Linux Presentation
Linux PresentationLinux Presentation
Linux PresentationNaiyan Noor
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxMedhat Dawoud
 
Linux Operating System (Presented in ICS Course at United International Unive...
Linux Operating System (Presented in ICS Course at United International Unive...Linux Operating System (Presented in ICS Course at United International Unive...
Linux Operating System (Presented in ICS Course at United International Unive...Md. Fahim Bin Amin
 
Operating Systems: A History of Linux
Operating Systems: A History of LinuxOperating Systems: A History of Linux
Operating Systems: A History of LinuxDamian T. Gordon
 

Similar a Linux command ppt (20)

introductiontolinuxpptbatch2-141025005514-conversion-gate01 (1).pdf
introductiontolinuxpptbatch2-141025005514-conversion-gate01 (1).pdfintroductiontolinuxpptbatch2-141025005514-conversion-gate01 (1).pdf
introductiontolinuxpptbatch2-141025005514-conversion-gate01 (1).pdf
 
Licão 01 introduction
Licão 01 introductionLicão 01 introduction
Licão 01 introduction
 
Linux for everyone
Linux for everyoneLinux for everyone
Linux for everyone
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Introduction and history of linux
Introduction and history of linuxIntroduction and history of linux
Introduction and history of linux
 
Linux forensics
Linux forensicsLinux forensics
Linux forensics
 
Chapter 8 - nsa Introduction to Linux.ppt
Chapter 8 -  nsa Introduction to Linux.pptChapter 8 -  nsa Introduction to Linux.ppt
Chapter 8 - nsa Introduction to Linux.ppt
 
1 Intro, Linux system Architecture, Features, File system Structure and appli...
1 Intro, Linux system Architecture, Features, File system Structure and appli...1 Intro, Linux system Architecture, Features, File system Structure and appli...
1 Intro, Linux system Architecture, Features, File system Structure and appli...
 
Linux for Librarians
Linux for LibrariansLinux for Librarians
Linux for Librarians
 
Linux Operating System. UOG MARGHAZAR Campus
 Linux Operating System. UOG MARGHAZAR Campus Linux Operating System. UOG MARGHAZAR Campus
Linux Operating System. UOG MARGHAZAR Campus
 
Course 101: Lecture 5: Linux & GNU
Course 101: Lecture 5: Linux & GNU Course 101: Lecture 5: Linux & GNU
Course 101: Lecture 5: Linux & GNU
 
Intro to linux
Intro to linuxIntro to linux
Intro to linux
 
Linux programming lecture_notes
Linux programming lecture_notesLinux programming lecture_notes
Linux programming lecture_notes
 
Basics you should know about UNIX and LINUX
Basics you should know about UNIX and LINUXBasics you should know about UNIX and LINUX
Basics you should know about UNIX and LINUX
 
A History of Linux
A History of LinuxA History of Linux
A History of Linux
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Linux Operating System (Presented in ICS Course at United International Unive...
Linux Operating System (Presented in ICS Course at United International Unive...Linux Operating System (Presented in ICS Course at United International Unive...
Linux Operating System (Presented in ICS Course at United International Unive...
 
Linux
LinuxLinux
Linux
 
Operating Systems: A History of Linux
Operating Systems: A History of LinuxOperating Systems: A History of Linux
Operating Systems: A History of Linux
 

Más de kalyanineve

Sorting and searching
Sorting and searchingSorting and searching
Sorting and searchingkalyanineve
 
Unit 5 graphs minimum spanning trees
Unit 5   graphs minimum spanning treesUnit 5   graphs minimum spanning trees
Unit 5 graphs minimum spanning treeskalyanineve
 
Unit 2 linked list and queues
Unit 2   linked list and queuesUnit 2   linked list and queues
Unit 2 linked list and queueskalyanineve
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structurekalyanineve
 

Más de kalyanineve (7)

Sorting and searching
Sorting and searchingSorting and searching
Sorting and searching
 
Unit 7 sorting
Unit 7   sortingUnit 7   sorting
Unit 7 sorting
 
Unit 5 graphs minimum spanning trees
Unit 5   graphs minimum spanning treesUnit 5   graphs minimum spanning trees
Unit 5 graphs minimum spanning trees
 
Unit 4 tree
Unit 4   treeUnit 4   tree
Unit 4 tree
 
Unit 3 stack
Unit 3   stackUnit 3   stack
Unit 3 stack
 
Unit 2 linked list and queues
Unit 2   linked list and queuesUnit 2   linked list and queues
Unit 2 linked list and queues
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
 

Último

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Último (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

Linux command ppt

  • 1. Linux Operating System CA 102/CS 104 Kalyani Neve.
  • 2. A Brief History of Linux 1991 August • Linux is introduced by Linus Torvalds, a student university of “Helsinki” in Finland. • While the linux you know today was developed with assistance of programmer. • Linus Torvalds still remain control of the evolving core of Linux O.S. :The Kernel . Linus Benedict Torvalds
  • 3. A Brief History of Linux 1992,March • In March 1992 Version 1.0 of Kernel came into market ,the first official release of Linux. • At this point Linux RAM most of the common Unix tool from compiler to networking software to “X-Windows”. Linus Benedict Torvalds
  • 4. A Brief History of Linux 1991 September Version 0.01 of Torvald's project is made available via ftp.funet.fi. Ari Lemmke, the systems administrator, gives the directory the name Linux. Linus had originally intended to call the new kernel "Freax". According to Wikipedia, the name Linux was actually invented by Ari Lemmke who maintained the ftp.funet.fi FTP server from which the kernel was originally distributed. Ari Lemmke
  • 5. A Brief History of Linux October 1991 Richard Stallman expresses interest in having the Free Software Foundation distribute a GNU system with the Linux kernel. December 1991 Robert Blum posts the first Linux FAQ January 1992 Minix creator Andrew Tannenbaum claims "Linux is obsolete" in a posting to comp.os.minix and starts a public discussion on the merits of Linux in which Linus Torvalds participates.
  • 6. A Brief History of Linux • First Linux "distribution", called MCC Interim Linux is released by the University of Manchester, England. (February 1992) • Version 0.95 of the Linux kernel released. First version to be able to support X-Window. (March 1992) • A Linux distribution called Softlanding Linux System (SLS) is released. (September 1992) • Software und System Entwicklung GmbH (SuSE) founded in Nuremberg, Germany. Distributes a German version of SLS with corresponding manuals. (November 1992)
  • 7. A Brief History of Linux 1993: • Version 1.0 of Slackware released by Patrick Volkerding. It is based on the SLS distribution. • Ian Murdock creates the Debian distribution. 1994: • Linux kernel version 1.0 released. • First issue of Linux Journal published Marc Ewing • Linux distributor Caldera founded by Ray Noorda of Novell & Ransom Love. Marc Ewing • Marc Ewing releases the first version of Red Hat Linux.
  • 8. A Brief History of Linux 1995: • Bob Young partners with Marc Ewing and forms Red Hat Software. • Apache web server project started as a series of patches to the NCSA HTTPd server (A Patchy server). 1996: • Linux kernel version 2.0 released.
  • 9. A Brief History of Linux • Linus Torvalds suggests that a "slightly overweight penguin" would be the best mascot for Linux. He recommends Larry Ewing's "Tux" penguin images. A Tuxedo Tux
  • 10. A Brief History of Linux • The following filed a suit against William R. Della Croce, Jr. (September 1996) – Linus Torvalds – Linux Journal, – Yggdrasil Computing, Inc., – Linux International – Work Group Solutions (Digital Equipment Corporation & Red Hat Software contributed to the cost of the legal process) to re-assign the Linux trademark to Linus Torvalds. The firm of Davis & Schroeder handled the case on an almost pro-bono basis. (Freeor reduced charge for public good) • Kool Desktop Environment (KDE) project announced.
  • 11. A Brief History of Linux 1997: • The Linux trademark dispute between William Della Croce and Linus Torvalds is settled, with Della Croce re-assigning the trademark to Torvalds. • Miguel de Icaza starts the GNOME project. 1998: • Version 1.0 of the K Desktop Environment (KDE) released.
  • 12. A Brief History of Linux 1999: • Linux kernel version 2.2 released. • GNOME 1.0 desktop released. 2000: • Microsoft CEO Steve Ballmer calls Linux "a cancer that attaches itself in an intellectual property sense to everything it touches." in an interview with the Chicago Sun-Times.
  • 13. A Brief History of Linux 2001: • Linux kernel version 2.4 released. 2003: • Linux kernel version 2.6 is released. • Novell acquires German Linux distributor SuSE. • Red Hat announces that they will no longer sell boxed sets of their Linux distribution for retail customers. Instead, they will distribute Linux to end users via a development distribution called Fedora Core.
  • 14.  Multi-user: • Each user’s shells, applications and commands are separate processes • Number of simultaneous users limited only by: – CPU speed and available memory – Min. response times required by users/apps  Multi-tasking: • Many jobs can be under way at the same time • Jobs truly simultaneous on multi-cpu  Time-sharing: • A single cpu is shared by all processes • Processes exec briefly, passing cpu to others • Process switches occur in miliseconds or less • Kernel gives process a sense of total control
  • 15. Applications of Linux AS the Linux is the OS, it provides lot of applications. Some of them given below: 1)Text And Word Processing Applications Star Office is Text and word application instead of WordPad and notepad. 2) Programming Language There is a wide verity of Programming and scripting languages and tools available for Linux. 3)X-windows X-windows is a highly flexible and configurable GUI environment that run on Linux as well as almost UNIX System.
  • 16. Applications of Linux 4) Internet tool It supports Netscape as well as Mosaic It provides wide and full range of software needed to create internet server. It also provide the complete network support to connect the internet. 5) Data bases Today Oracle, Sybase and Informix all offer relational data base provides for Linux. 6) Dos and Windows Capability Software Linux can be made to run DOS software with high degree of stability and compatibility.
  • 17. Acquiring and using Linux There are quite a few ways to obtain a Linux distribution. 1. One way is to go to the distributor's website and download the linux distribution of our choice. For example, If you want to download a. Mandrake, the go to http://www.mandriva.com/. b. SUSE Linux Enterprise Server 9, go to http://www.novell.com/linux/download_linux.html.
  • 18. Acquiring and using Linux 2. Other way is to obtain pre-burned copies of the Linux distribution we need from the distributor’s website or from sites like cheapISO.com – The price is of such distributions starts from less than Rs. 100/- – Some new computers have Linux as preinstalled
  • 19. Examining Linux Distributions • A Linux distribution is a collection of software that incorporates a version of the Linux kernel, versions of the assorted GNU tools, and various other bits and pieces like XFree86, the Open Source version of the X-windows system. • Many vendors of distributions offer this collection as a basic version, and charge (extra) money for versions that incorporate or include various non-free programs.
  • 20. Survey of Major Distributions • The major distributions of Linux include: – Caldera – Debian – Mandrake – Red Hat – Slackware – SuSE – Turbolinux
  • 21. Linux distributions. Website/Logo Red Hat Linux: http://www.redhat.com/ SuSE Linux: http://www.suse.com/ Mandrake Linux: http://www.mandrakesoft.com/ Caldera Linux: http://www.calderasystems.com/ Debian GNU/Linux: http://www.debian.org/ Slackware Linux: http://www.slackware.com/
  • 22. X-WINDOWS • X-Windows is GUI for UNIX Which sets up the graphics display • X-Windows is a highly configurable environment that (resolution , refresh rate, color depth),displays the windows and provides a broad range of flexibletrack mouse movements , key operation for both strokes the user and application developers. • On X-Windows system two application must run to provide the complete GUI 1) X-server It provides menu, windows border, 2) window manager mechanism for moving ,switching, minimizing or maximizing windows.
  • 23. Components of the X Window System • X server • X client • Window manager • Graphical libraries • Graphical application – Provides a comprehensive user interface
  • 24. Components of the X Window System (continued)
  • 25. Starting X • $ startx – Standard command to start X window system H.W Similarities and differences between X-windows and Microsoft windows
  • 26. Desktop Interfaces • Graphical environment – Provides collection of functions and utilities – Makes using computer easier for those who do not have many commands memorized • KDE interface – Most widely used desktop environment on Linux systems – Installed by default for most distributions, except Red Hat
  • 27. Desktop Interfaces (continued) • KDE interface includes suite of applications – Internet access – System maintenance – Personal productivity – Other basic tasks • Panel – Set of icons at bottom of screen
  • 28. Desktop Interfaces (continued) • GNOME desktop – Stands for GNU object model environment – Very similar to KDE – Includes panel with integrated taskbar – Applications included similar to those with KDE – Installed by default for Red Hat
  • 29. Working with Graphical Windows (continued)
  • 30. Configuring GNOME and KDE • GNOME and KDE – Both highly configurable
  • 32. Unit -2 System Access Logging In and using the Linux system Linux Commands Logging In and using Remote Linux system
  • 33. 2.1 Logging in and Using Linux System Because the system can be used by many users some has to be given charge of administration of the system called ‘system administrator’ who will grant you the authority to use the system . login: kumar Password:******* This will start up a desktop. The default desktop in RedHat Linux 9 is GNOME desktop. If you want to turn off your computer, you must first shut down Linux. You can shut down your system in three ways: 1)By using halt command. Main Menu 2)By using shutdown command. Logout menu
  • 34. #halt This command will log you out and shut down the system. •$ halt # shutdown shutdown 16:00 shut down at 16:00 shutdown -r now shutdown immediately and reboot shutdown -h now shutdown immediately and halt Linux also allow alt+ctrl+del
  • 35. Saving Your Configuration Between Logins • On logout – GNOME can note which application windows were open – Same applications are opened automatically at next login • Can also save configuration between logins
  • 36. Configuring the Graphical Login Screen • Before you are permitted to configure most parts of graphical login screen – Must be logged in as root or enter root password • Select system settings, then Login Screen on GNOME main menu – Or runrun gdmsetup command • Configure login options
  • 37. Basic Commands How to run commands • Finder => Application => Utilitaires => Terminal • When you log on Unix machine, you will see, [someone]$ • One command consists of three parts, i.e. command name, options, arguments. Example) [someone~]$ command-name optionA optionB argument1 argument2
  • 38. Basic Commands How to run commands • Between command name, options and arguments, space is necessary. • Options always start with “-” • Example: cd .. ls –l .bashrc mv fileA fileB
  • 39. Some more Linux commands Everything in the square bracket is Name Syntax optional • Cal • Cal [ [ month ] year ] • E.g. $ cal Current date Current date Wed augcal 3 1985 • $ 31 Wed aug31 16:22:40 IST 16:22:40 IST 2005 2005 Month no Month no • Date • $ date 08 08 Month name Month name Month no with • $ date +%m Aug name with Month no Aug name • $ date +%h 08 Aug 08 Aug • $ date +”%m %h”
  • 40. To display the a: bell To display the message on the backspace message onb:the • $ echo • $ printf screen c:current line screen • Syntax: echo Linux n :•new line printf Linux Syntax: t tab $ echo [-ne] [string] -e: enables the interpretation of back slash special character in string. -n: disable o/p of trailing new line Who: The o/p of this command is linux gives us a details of the user who have logged the linux system currently e.g. $ who o/p: student tty10 july 30 7:14 Terminal name
  • 41. clear : Clears the terminal screen and resets the prompt and cursor location to the first line of the screen. $ clear . Free: Displays a report of free and used memory. Free [-b|-k|-m][-s delay][-t] -b: Displays amount of memory in bytes. -k: Displays amount of memory in kilobytes(this is default).[$ free] -m: Displays amount of memory in megabytes. -s delay : Displays continue reports separated by specified delaying seconds[^z to escape it] -t: Displays an extra line containing totals.
  • 42. kill: You can terminate process with kill command. The command uses one or more PID’s as its argument. $ kill 122 129 115 sleep: This command will suspend the execution of shell. The maximum limit of sleep is 18000 second. Unfortunately keep the terminal idle. $ sleep [seconds] ps: This command will displayed the process status .submmission time ,required CPU time, Process name. $ ps [option] -a: Print all terminal process. -e: Print all current process. -t: Print all processes of listed terminal. -u: Displays processes of listed user.
  • 43. Basic Commands 1.Jumping directly to the line. Commands 2. Jumping directly beginning and ending of the file. 3. Move backward through the file. • ls show files in current position 4. Search backward through the file. • pwd show current position • cd change directory • less, more display file contents • man xman display online manual(help pages) • find ,grep For searching for a file.GREP.docx • su switch user • cat For i/p and o/p on the screen • wc count word char and no.of line in a given file Basic command1 Basic Command2
  • 44. Basic Commands Commands This command we will see in next unit. • passwd change password • useradd create new user account • userdel delete user account • mount mount file system • umount unmount file system • df show disk space usage • cp copy file or directory • mv move file or directory • rm remove file or directory • mkdir create directory • rmdir remove directory
  • 45. Relative & Absolute Path • Path means a position in the directory tree. • To express a path, you can use relative path or absolute path. • In relative path expression, the path is not defined uniquely, depends on your current path. • In absolute path expression, the path is defined uniquely, does not depend on your current path.
  • 46. Relative & Absolute Path • Relative Path Ablsoute Path pwd cd cd . mkdir mydir pwd pwd cd .. pwd cd /Users/invite cd .. pwd pwd cd /Users cd pwd cd / pwd cd /Users/invite cd ~/mydir
  • 47. User Accounts Creating additional user accounts This creates the Useradd- $ useradd user1 user with all default setting 1) Creating a entry of user in /etc/passwd file with password 2) Assigning a user ID to user .it is greater than all other user ID. 3) Adding user to appropriate group. 4) Creating a home directory for the user. $ useradd –u 500 user1 $ useradd –g group-name user1 1) If you want to use particular user ID. 2) If you want to assign a particular group to user. 3) If you want to specify an alternative home directory for a user. $ useradd –d directory-name user1
  • 48. usermod: Modifying the user usermod is used for , modifying some of the parameters set with useradd. e.g. usermod –s /bin/bash oracle *We can combine all the option in this way. The useradd command adds new user to the system. $ useradd –u 210 –g dba –d /home/oracle –s /bin/ksh oracle
  • 49. Managing user accounts Change Password o/p: old passwd: $ passwd New passwd: New passwd: Deletes the Removing user user Deletes the user $ userdel user1 and its file $ userdel –r user1
  • 50. Creating Group Creating Group $ groupadd [option] group-name 1) -F : If the group is already available then it should display result. 2) –g : Group ID is suppiled by this action. 3) –o : giving ID which is not unique. 4) –r : Add to system account.. Deleting Group $ groupdel group-name
  • 51. Adding user to Group • There is no standard program available to add the user to a group • In order to do this we can directly edit the file /etc/group. Group-name :: password : group-id : user-list Name of Encrypted password to Unique Group ID in Comma Group the group numeric form seperated user list who want to add this group
  • 52. Modifying Group If you want to change a group name you can use the groupmod command. e.g change the group’s name from test1 to test2 # groupmod –n test2 test1
  • 53. Managing Users: For the creation and maintenanace of user accounts, Linux provides 3 commands :useradd,usermod,userdel useradd : Adding user The useradd command adds new user to the system. $ useradd –u 210 –g dba –d /home/oracle –s /bin/ksh oracle jh This quietly creates the user oracle with a UID of 210 and name dba.The home directory is /home/oracle, and user will use the Korn shell. The – option ensures that the home directory is created if it doesn't already exist and copies a sample .profile and .kshrc to the user’s home directory.
  • 54. usermod: Modifying the user usermod is used for , modifying some of the parameters of already existing users. e.g. usermod –s /bin/bash oracle • userdel : Removing user Users are removed from the system with userdel. userdel oracle
  • 55. Unit -3 Introduction to File System And Linux Permission Managing File. Managing Directory. Understanding permission. Evaluating System Security.
  • 56. File contains 3 types of information User data System data Executable file File Name 1)File name is upto 256 character. 2)This character can be a lower case ,upper case,numbers and other character like hypen(-), under scroll(_) and period(.) 3)Don’t include Meta character because they have special meaning(*,?,&,/ etc)
  • 57. Standard directory structure ◮ / - the topmost ◮ /dev - all the devices are accessible as files ◮ /var - “variable” data such as mails, log files, databases ◮ /usr - almost all the packages installed ◮ /etc - configuration files ◮ /home - home directories for all the users ◮ /root - home directory of the privileged user root ◮ /mnt - used to mount other directories/partitions
  • 58. File Navigation 1) Navigating using GUI 2) Navigating using terminal Navigating using GUI  Main menu Home folder Nautilus file manager You can give any address to this location bar and nautilus will displayed the contents at that location In this way you can navigate up to root directory
  • 59. Navigate using terminal • Open terminal • Type the command 1) pwd: It gives present working directory $ pwd 2) ls: It displays the list of file and directory $ ls [option] 3) cd: Change directory $ cd dir-name 4) For searching file. Locate command Find command $ locate file-name $ find start-dir parameter action
  • 60. Managing File system • Creating a file • Deleting a File • Copy a File • Move a file • Archiving a File • File Compression  Creation of a File: cat is used for creation of file. Enter command cat followed by the > character and file name. $ cat $ cat > fileName1 $ cat fileName1 $ cat >> fileName1 $ cat > fileName2 $ cat fileName1 fileName2 $ cat fileName1 fileName2 > fileName3
  • 61. Copying A File : • The cp command copies a file or a group of files. • It creates an exact image of a files on disk with different name. • The syntax requires at least 2 files names to be specified in the command line. • When both are ordinary files the first is copied to other. • If the destination file (unit1) doesn’t exist it will first be crated before copying takes place. • If already exist it will simply overwritten without any warning from the system. e.g $ cp file1 file2 $ cp file1 /temp Copy multiple file $ cp file1 /temp/file2 Copies all directories and sub $ cp file1 file2 file3 /tem/file4 directories. $ cp *.txt *.doc *.bak /tem/file
  • 62.  Deleting file: The rm command deletes one or more files. $ rm file1 $ rm file1 file2 file3 $ rm *.txt
  • 63. .  Renaming Files: The mv command renames (moves) file .It has 2 distinct functions. 1) It renames a file (or dir). 2) It moves a group of file or different directory. mv doesn’t create a copy of the file only renames it. No additional space is consumed on disk during renaming. $ mv file1 /tmp $ mv file1 /tmp/file2 $ mv *.txt , *.doc,*.bak /tmp
  • 64. Locating the File System Using GUI Using command line Main Menu 1) Use locate command All files wit the given File Option $ locate FileName extension 2) There are various option like- Specify Name of file which you want to search(In i) $ locate *.extension Dialogue Box) ii) $locate –i fileName Click on file (we get location of the file in the box)
  • 65. Making Directory To create a new directory use the mkdir command ,the syntax is: $ mkdir DirName Deleting Directory To delete whole directory use –r flag with rm command . e.g. $ rm –r DirName
  • 66. File Ownership and permission  In Linux each file is owned by that user who created it. The owner of the file has the right to read the file, run it, delete it.  Each file and directory in Linux contains set of permission that determine who access them and how.  Other user can do only those things for which the owner has given the permission.  A file also belongs to a group.  Each user on the system is a memberof one or more group. Date of Name of Access  To see the file ownership details creation use file $ ls –l Permission Total 866 -rw –r – 1 root root 2045 oct 23 1997 Dir-colors File Owner File Group Size of file
  • 67.  To change owner of file $ chown user-name filename $ chown u1 f1  To change a group of file $ chgrp group-name filename $ chgrp g1 f1
  • 68. Access permission for a file is divided into three: 1)File owner(denoted by u) 2)Members of a file group(g) 3)Others(o) Others Permission e.g. rwx rwx rwx (o) Owner user (u) Group 1) r: Indicate the read permission. permission 2) w: Indicate the write permission (g) 3) x: Indicate execute permission 4) -: Indicate that particular permission is denied.
  • 69. To change the access permission of a file/directory. $ chmod <mode> file-name + - In this mode we can change all To permission at one time using 3 sets of grant/revok 3 binary digits. e the e.g.$ chmod 755 mydata permission This command allows the user to read write and execute while it allows the group and others to read and execute only. Symbolic Mode Absolute Mode (u):User Owner (g):for group (o): for other user
  • 70. • Chmod u+r file-name: gives owner to read the permission • Chmod g-x file-name: takes away to execute the permission from group • Chmode o+rx-w file-name: allow others to read and execute but not to write permission
  • 71. Unit -4 Creating And Viewing the File And Archiving the File. Using Vi editor and other editor. Examine file content,redirection. Archiving the file with tar and cpio. Zipping file .
  • 72. There are various editors as follows: 1) Vi editor 2) Vim editor  Link 1 3) Emac editor  Link 2 4) Ed editor  Link 3 5) Joe editor 6) Red editor GO
  • 73. Vi editor  It is a full screen text editor that enables you to view ,to create and edit a file several lines at a time .  Most Unix system ,including Linux come with Vi. Vi works with buffer as Vi edits the file ,read a file into buffer and enables you to change the text in buffer .  Before you start a full screen text editor such as Vi you must set the TERM environment use the terminal type of lookup the terminal characteristic in the etctermcap file and then control the terminal in the full screen mode. Vim editor  This is a enhance version of Vi editor .  It includes various enhancement over the Vi editor such as syntax highlighting, command line editing and online help .  The Vim editor can be used to edit as ASCII text, it is specially useful for editing the programs. Back
  • 74. emac editor  “the edit macro ” or emac editors is the next widely used editors. It provides the larger set of commands than Vi editors.  The editors is used to format source code for programming languages such as C and C++.  It allows to work with multiple file at a time .  Emac editor offer ispell utility to check the spelling in the document.  It also offers the online help. ed editor  To use the line editor or ed to creates display , modify, save text files.  When you start ed editor with file name as an argument, a copy of a file is created in the editor buffer. You can make changes only to the copy of a file and not directly to the file.  To save the changes to the file you use w command. Back
  • 75. Joe editor  You can invoke the Joe editor by typing at the command prompt.  The Joe editor is a full screen editor that lets you edit both programs and text. red editor  You can use the restricted editor or red editor  To edit the file in the current directory you can not execute shell commands by using the red editor. Back
  • 76.  Archiving Files: Tar Specifies that you are  creating an archive as used to create archive known as tar archive. This command is opposed to viewing an This command create new archive with new file name. existing archive  Tar file has .tar extension. Copy a file into archive the file into archive so there is no danger that This process copies original file will be deleted in process. Syntax: $ tar cvf tar file-name file_list Means you are archiving in a file as opposed to temp drive f represents the file. Indicate that each command should be verbose mode. which means that each file name will be displayed as it is copied into archive.
  • 77. e.g.1) $ tar cvf text.tar *.txt It copies all .txt file and create archive file with the name text.tar 2) $ tar cvf vnc.tar vnc It copies all contents of vnc directory.  To view the contents of archive file replace c by t .  e.g. $tar tvf vnc.tar  To extract contents of an archive into current directory replace c by x  e.g. $ tar xvf vnc.tar
  • 78. Other Option of the tar command •-r : To append the file to an archive . That means archive can contain several file with same name. •-u : It also add the file to an archive but only if the file is not already there or if file is there then overwrites it. •-w : It permits interactive coping and restoration. It prints the file name and prompts for the action to be taken (Y /N)
  • 79. Create Compression A compressed archive is a single file that contains one or more file in a compressed form. Every Linux system comes with all or some of the following compression and decompression utilities. • gzip and gunzip (.gz) • bzip2 and bunzip2(.bz2) • Zip and unzip (.zip)
  • 80. Gzip • While tar is useful for archiving the file, it doesn’t perform any compression. • It is done with the gzip command • It adds .gz extension to the end of the file. • It compressed individual file but not create archive. • It saves the memory. E.G. $ gzip text.pdf o/p: It creates the compressed file with the name text.pdf.gz $ gzip * o/p: It compressed all files in the current directory but not in sub directory. $ gzip –r * o/p: It compressed all files in the current directory and also in sub directory.
  • 81. To uncompressed the file $ gzip –d text.pdf.gz Alternative to –d option(gunzip) $ gunzip text.pdf.gz To view the compressed text file, no need to decompressed $ gzcat text.pdf.gz or $ gzmore text.pdf.gz Combining gzip and tar alternative $ tar cvf text.tar *.txt $ gzip text.tar It creates single compressed archive of all .txt file with the name text.tar.gz
  • 82. Bzip2 and bunzip2 •Its working and functionality is same as gzip and gunzip resp. •If you know gzip and gunzip then you also know the bzip2 and bunzip2. •Bzip2 is slower than gzip and creates .bz2 files.
  • 83. Zip and unzip •Compressing and archiving together. •Zip requires first argument to be compressed file name, the renaming arguments are interpreted as files and directories are to be compressed. It compressed the t1.html and •The unusual features of this command is thatthe doesn’t overwrite an t2.txt and make it single existing compressed file. If it isarchive with the name text.zip be updated already exists ,file either or appended to the archive . It compressed all files in current directory but not in sub directory and make the single e.g. $ zip text.zip t1.html t2.txt archive with the name text.zip It compressed all files in current $ zip text.zip * directory and also in sub $ zip –r text.zip * directory and make the single archive with the name text.zip To Unzip the file It decompressed all files and $ unzip text.zip come all the files in the original form
  • 84. Archiving File with cpio (copy input output) •The cpio command copies the file to and from a backup devices. •It uses standard input to take the list of file names. •It then copies them with their contents and headers to the standard output which can be redirected to the file and device. •This means that cpio can be used with redirection and piping •Cpio uses two key option i)–o (output) ii)-I (input) Either of which but not the both must be there in command line.
  • 85. Backup files (-o) •Since cpio uses only standard input you can use ls to generate list of file name to serve as its input. •The –o key option creates the archive on the standard output ,which you need to redirect to a device file. •This is how you copy the file in the current directory to a 1.44mb floppy. •$ ls | cpio –ov > /dev/rdsk/f0q18dt or •$ ls | cpio –o > /dev/rdsk/f0q18dt •$ find / -name “f*” –print | cpio –o > / dev/rdsk/f0q18dt
  • 86. Restoring Files (-i) •A complete archive or selected files can be restored with the – (i) key option . •To restore the files use the redirection to take input from the device. •$ cpio –iv < /dev/rdsk/foq18 •Cpio also accepts a quoted wild cards pattern so multiple files fitting the pattern can be restored. •$ cpio –I “*.sh” < /dev/rdsk/f0q18
  • 87. Displaying the archive (-it) •The –t option displays the content of the device without restoring the files. •These option must be combine with the (-i) key option •$ cpio –itv < /dev/rdsk/foq18 Other Option •-r : It renames the file before starting the coping process . The system presents each file name and waits for a response .If you enter the file name coping is done with that file. •A null response leaves the file uncopied. •-f : This option followed by the expression causes cpio to select all files except those in the expression $ cpio –ivf “*.c” < /dev/rdsk/foq18 •It restores all files except C program.
  • 88. Dump and restore utility •You can use the dump utility to back up the file from file system •Typically it is used for back up the data not for archiving •The restore utility performs the inverse function of the dump utility e.g.1) $ dump <back up level> [option] file system 2) $ Restore <operation> [option] files
  • 89. What is shell? The shell is a program used to interface between you and the linux. User Linux Shell Program Linux Kernel
  • 90. How the shell get’s started? Generally the ‘bash’ is the most popular and default shell. In X-windows you can start a shell by running terminal window (such as x- term) The most Common Shell • Sh (Bourne shell) • C shell • Ksh (Korn shell) • Bash (Bourne Again Shell)
  • 91. Features Of Bash $ cd t<tab><enter> 1)Command Line Completion 2)Wild cards There are 3 types of wild cards 3)Command history1)* : Matches any character and any no of character 4)Aliases 2)? : Matches any single character 3)[…] : Matches any single character content within the braces. • HISTSIZE • .bash_history $ cd /user /x11/Lib/x11/FVWM/sample-config $ alias gosample=‘cd /user /x11/Lib/x11/FVWM/sample-config’ $ cd gosample $ unalias gosample
  • 92. Redirection Symbol •Input Redirection(<) •Output Redirection(>) •Output Redirection with append mode(>>) Pipeline Output from first command in the pipeline is used as the input to the second command in the pipeline e.g. $ cat sample.txt | grep “high” | wc -l
  • 93. Prompts •First level ($) •Second level (>) Ps1=“Please enter the command” Ps2=“I need more information”
  • 95. UNIT V Working in X Windows
  • 96. X Windows (X11) • History of X – Developed at MIT in 1984 – Derived from Stanford project called W – X is now freely distributable, and available for UNIX, Windows, and Mac.
  • 97. • The X Windows system is the standard graphical interface for UNIX – Distinguishing features: – Allows multiple virtual terminals to be opened at once – Highly Customizable and extensible – Highly Portable – Works over networks
  • 98. X Windows Architecture • Separation of display and programs • Connected by TCP/IP • Your display is the X server • Programs that run are clients • Confusing because backwards from what we are used to.
  • 99. • It is important to note that X is a network-oriented graphics system. • That is, X clients can run either locally (on the same system that the server is running) or remotely (on a system somewhere on a TCP/IP network). • The X server listens to both local and remote network sockets for requests from clients. This feature is obviously quite powerful. If you have a connection to a TCP/IP network, you can log in to another system over the network and run an X application there, directing it to display on your local X server.
  • 100.
  • 101. • From the beginning it incorporated many of the windowing capabilities that we now take for granted. • These capabilities include network transparency, graphical capability, the use of a mouse, and the ability to link together a heterogeneous network of workstations from different vendors .
  • 102. • One of the most significant features of X is that it was specifically designed to work across a network. • The client and the server communicate via the X Protocol, a network protocol that can run locally or across a network. Regardless of whether a client program is local or remote, it communicates with the server through the X Protocol.
  • 103. Managing Files and File systems Types Of Description File System Ext Earlier version of Linux File System ,no longer in use Ext2 Older standard Linux file system Ext3 standard Linux file system Msdos File system for MSDOS Ntfs File system for Windows NT ,Windows XP ,windows 2000 Iso9660 File system for mounting the CDROM Fd0 Mounting the file system to the floppy drive.
  • 104. Managing Files and File systems • Under Linux, filesystem types include the Second Extended filesystem, or ext2fs, which you probably use to store Linux files. • when you access any file system under Linux, the system presents the data as files arranged into a hierarchy of directories, along with owner and group IDs, permissions bits, and the other characteristics you're familiar with.
  • 105. • Information on file ownership, permissions, and so forth is provided only by file system types that are meant to be used for storing Linux files. • As the system administrator, you need to know how to create file systems should you want to store Linux files on a floppy or add additional file systems to your hard drives.
  • 106. • Mounting Filesystems: In order to access any filesystem under Linux, you must mount it on a certain directory. This makes the files on the filesystem appear as though they reside in the given directory, allowing you to access them. The mount command is used to do this and usually must be executed as root. Syntax: mount -t type device mount-point
  • 107. • where type is the type name of the filesystem • device is the physical device where the filesystem resides (the device file in /dev) • mount-point is the directory on which to mount the filesystem. • For example, if you have a Second Extended filesystem on the partition /dev/hda2, and wish to mount it on the directory /mnt, use the command: mount -t ext2 /dev/hda2 /mnt
  • 108. • To mount a floppy that was created on a Windows system and therefore is in DOS format, you use the command: mount -t msdos /dev/fd0 /mnt • This makes the files available on an MS-DOS format floppy under /mnt. • The inverse of mounting a file system is, naturally, unmounting it. • Unmounting a file system has two effects: it synchronizes the system's buffers with the actual contents of the file system on disk, and it makes the file system no longer available from its mount point. You are then free to mount another file system on that mount point.
  • 109. • Unmounting is done with the umount command (note that the first "n" is missing from the word "unmount"), as in: umount /dev/fd0 to unmount the filesystem on /dev/fd0. • Similarly, to unmount whatever filesystem is currently mounted on a particular directory, use a command such as: umount /mnt
  • 110. Creating File systems • A filesystem can be created using the mkfs command. Creating a filesystem is analogous to "formatting" a partition or floppy, allowing it to store files. • Syntax: mkfs -t type device blocks where type is the type of filesystem to create, device is the device on which to create the filesystem (such as /dev/fd0 for a floppy), blocks is the size of the filesystem,
  • 111. • For example, to create an ext2 filesystem on a floppy, you use this command: mkfs -t ext2 /dev/fd0 1440 • Here, blocks is 1440, which specifies a 1.44- MB, high-density 3.5-inch floppy. You could create an MS-DOS floppy using -t msdos instead.
  • 112. Checking and Repairing File systems • It is sometimes necessary to check your Linux file systems for consistency and repair them if there are any errors or lost data. Such errors commonly result from a system crash or loss of power. • The program fsck is used to check file systems and correct any problems. Like mkfs, fsck is a front end for a file system-type-specific fsck.type, such as fsck.ext2 for Second Extended file systems.
  • 113. • Syntax: • fsck -t type device • For example, to check an ext2 filesystem on /dev/hda2, you use: • fsck -t ext2 /dev/hda2
  • 114. Customizing X Environment Xinit – You run X with the startx command. – This is a front end for xinit, the program responsible for starting the X server and running various X clients that you specify. – xinit (via startx) executes the shell script .xinitrc in your home directory. – This script simply contains commands that you wish to run when starting X, such as xterm, xclock, and so on. – If you don't have a .xinitrc file, the system default /usr/lib/X11/xinit/xinitrc is used instead of that.
  • 115. Running startx with this particular .xinitrc in place gives you something that looks like
  • 116. Configuring X-Windows • Configuration of X11 is a multi-step process. – # Xorg –configure – This will generate an X11 configuration skeleton file in the /root directory called xorg.conf.new. The X11 program will attempt to search the graphics hardware on the system and write a configuration file to load the proper drivers for the detected hardware on the target system.
  • 117. • # Xorg -config xorg.conf.new – Test the existing configuration to verify that Xorg can work with the graphics hardware on the target system. • # Xorg -config xorg.conf.new -retro – this test produces a black screen which may make it difficult to diagnose whether X11 is working properly. The older behavior is still available by using the retro option. • If a black and grey grid and an X mouse cursor appear, the configuration was successful. To exit the test, switch to the virtual console used to start it by pressing Ctrl+Alt+Fn (F1 for the first virtual console) and press Ctrl+C.
  • 118. GNOME • The GNU Network Object Model Environment also known as GNOME. • It consist of Panel, desktop, set of GUI tool • GNOME is provided a flexible platform for the development of powerful application • GNOME is strongly supported by several distribution and is the primary interface for red hat and mandrake.
  • 119. Advantages Of GNOME • It is open source software , it is available free of cost. • GNOME supports the drag and drop feature. • GNOME documentation is extensive and you can view the document by using the GNOME help browser or any web browser such as Netscape Navigator. • GNOME support many national languages and you can add new language without making any additional changes to the s/w.
  • 120. Choosing And Changing Window Manager And Desktop • GNOME works with any window manager. • However desktop functionality such as drag and drop capabilities and the GNOME pager only work with window manager that are GNOME compliant. • The current release of GNOME uses the sawfish window manager. • If you have several window manager installed on your system you can change from one to other using the window manager caplet. • Caplet is the term used for a control panel , a module used to configure your desktop. • select the window manager entry in main menu to start a setting menu or select its icon in the desktop.
  • 121. Continued…. •Windows opened from perform preferences in the start here window. A Panel is displayed listing your window managers. •To add others to the list click on Add button on the right side of the panel. •This open the window that prompts you to enter an identifying name for the window managers the command that starts the window managers and any configuration tool it may used. •If the window manager is GNOME compliant you can click the button window manager Is session Managed. •Once you finished making your entries and click OK the new window manager appears in the list on the window manager panel select it and click. •Try to run that window manager. To run window manager configuration tool, click run configuration tool button.
  • 122. Remote X window access While running X on the system the X servers run on the computer and controls the monitor keyboard and mouse. The server responds to command that X client sends that open window and draw in those window. The X client may run locally or on the remote system. The argument is called as client server model. A server provides the source that the client request. Client communicate with server through network. X display server offered graphics display server to client that send X-protocol request to the server . File servers and database servers request are usually process executing on remote machine. .
  • 123. Continued… The X client may run on locally or remote system with the name of script file as a parameter first. This should work but it would be much better if we could simply revoke the script by typing its name giving it the respectability of the linux command. We do this by changing the file , make a file executable for all user using the mode cmd $ chmod +x first . Chmod to make a file executable use man and chmod to find out more about octal arguments and other option

Notas del editor

  1. “ ls ” stands for list. Ls –l gives the discription about which is directory and which is file. Directory is indicated by letter d and file is indicated by hypan(-). Pwd stands for present working directory $ pwd $ cd dir-name $ cd dir1 dir2 $ find storing directory parameter action(it searches a file or dir) Storing directory- where tobe search Parameter –on what criteria tobe search Action- what action tobe performed $ grep word file name(it searches word in a given file) “ su ” means switch user. When you have several user account on one machine.