Difference between revisions of "Linux"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 108: Line 108:
 
# The grep command      
 
# The grep command      
 
#* To see the content of a file
 
#* To see the content of a file
#** eg. cat filename
 
 
#* To list the entries of a particular stream
 
#* To list the entries of a particular stream
#** eg. grep “option” filename
 
 
#* To ignore cases
 
#* To ignore cases
#** eg. grep -i “option” filename
 
 
#* Lines that do not match the pattern
 
#* Lines that do not match the pattern
#** eg. grep -iv “option” filename
 
 
#* To list the line numbers with the entries
 
#* To list the line numbers with the entries
#** eg. grep -in “option” filename
 
 
#* To store the result in another file
 
#* To store the result in another file
#** eg. grep -iv “option” filename > filename
 
 
#* To know the count
 
#* To know the count
#** eg. grep -c “option” filename
+
 
  
  
Line 126: Line 120:
 
#* Search using grep
 
#* Search using grep
 
#* To match more than one pattern
 
#* To match more than one pattern
#** eg. grep -e “option1” -e “option2” filename
 
 
#* To check a word that has different spelling
 
#* To check a word that has different spelling
#** eg. grep -ie “option” -ie “option” filename
 
 
#* Character class
 
#* Character class
#** eg. grep -i “option” filename
 
 
#* The use of *
 
#* The use of *
#** eg. grep -i “option*” filename
 
 
#* To match any one character using dot
 
#* To match any one character using dot
#** eg. grep “option...” filename
 
 
#* To match a pattern at the beginning of the file
 
#* To match a pattern at the beginning of the file
#** eg. grep “^option” filename
 
 
#* To match a pattern at the end of the file
 
#* To match a pattern at the end of the file
#** eg. grep “[option]...$ ” filename
+
 
  
 
# The sed command      
 
# The sed command      
Line 144: Line 132:
 
#* editor
 
#* editor
 
#* display
 
#* display
 +
#* sed
 +
#* To print using sed
 +
#* Line Addressing
 +
#* Context Addressing
 +
 +
 +
#Some more on sed command    
 
#* substitute
 
#* substitute
 
#* insert
 
#* insert
 
#* delete
 
#* delete
 +
 
#Basics of awk      
 
#Basics of awk      
 
#* Awk Preliminaries
 
#* Awk Preliminaries
Line 156: Line 152:
 
#* NR - number of records
 
#* NR - number of records
 
#* Variables
 
#* Variables
 +
 
# Programming with awk      
 
# Programming with awk      
 
#* Reading the program from a file (-f)
 
#* Reading the program from a file (-f)
 
#* The BEGIN & END section
 
#* The BEGIN & END section
 
#* Control Constructs
 
#* Control Constructs
 +
 
# Advanced features of awk      
 
# Advanced features of awk      
 
#* Array
 
#* Array
 
#* Function
 
#* Function
# Simple Filters    
+
 
#* grep
+
#* sed
+
#  Basics of Shell Scripting    
+
#* variables
+
#* Logical Operators
+
#* Arithmatic Operators -expr,test etc.
+
#* Conditional Construct -if,case etc.
+
#* Looping construct - for,while etc.
+
#* Example script
+
 
# Networking tools      
 
# Networking tools      
 
#* Ping
 
#* Ping
Line 179: Line 168:
 
#* ssh
 
#* ssh
 
#* scp & sftp
 
#* scp & sftp
# More about Linux Process      
+
 
 +
# Linux Process      
 
#* Fork
 
#* Fork
 
#* Exec
 
#* Exec
Line 185: Line 175:
 
#* Nice
 
#* Nice
 
#* Kill with options
 
#* Kill with options
 +
 +
 +
# More about Linux Process    
 
#* Cron, crontab
 
#* Cron, crontab

Revision as of 16:40, 23 April 2013

Linux is one of the most popular Operating Systems used in today's world. Linux refers to the family of Unix-like computer operating systems using the Linux kernel. Linux can be installed on a wide variety of computer hardware, ranging from mobile phones, tablet computers and video game consoles to mainframes and supercomputers.

It is an opensource software and the Linux kernel is released under the GNU General Public License and hence can be freely created, modified and distributed.

Linux is actually just a kernel. Many people have put together distributions (often called flavors), that contain not just the kernel but also many other programming tools and utilities. Some well-known distributions include Red Hat Linux, Ubuntu, SuSE Linux, and Debian GNU/Linux.

The real power of Linux can be tapped by using its wide and powerful storehouse of commands which need to be typed in on the terminal. The reason behind this is the fact that Linux can trace its intellectual heritage, if not its source code, to the Unix OS. Unix was developed much before GUI environments were dreamt of. Thus, Unix (and hence Linux) provides a wide array of flexible text-mode commands.

In this tutorial we would mainly concentrate on how to use the wide variety of commands of Linux to handle files,directories,processes etc. These tutorials are created using Ubuntu version 9.04 and above. Please see the associated text box of individual spoken tutorials on the website to decide the versions of Linux OS to which it is applicable.

The Spoken Tutorial Effort for Linux is being contributed by Ms. Antara De from IIT Bombay and Mr. Anirban Roy Choudhury. Other contributors who helped in the creation of the scripts include Mr. Neel Mehta from IIT Bombay who has contributed the lesson on 'Shell Scripting' and Mr. Shahid Ali Farooqui who has contributed the lesson on 'File Attributes'.

Linux Slide Template (TEX Format)                                                                                                                               Glossary
                                         (PPT Format)
                                         (ODP Format)

Introduction to Linux - Novice

  1. Getting Started    
    • What is Linux
    • Difference between Unix, Linux and GNU
    • Different Linux Distributions
    • Installation of Linux from Windows (By Wubi Installer )
    • Dual Boot
    • The GNOME desktop
    • The terminal window
  2. Basic Commands    
    • Commands with example
    • Command interpreter
    • Shell
    • Using man
    • Apropos
    • Whatis
    • Using --help option
  3. General Purpose Utilities in Linux    
    • echo
    • uname
    • who
    • passwd
    • date
    • cal
    • Brief overview on Files and directories
    • pwd
    • ls
    • cat
  4. File System    
    • File
    • Directory
    • File Inode
    • Types of Files
    • Home directory and Current directory
    • Change Directory(cd)
    • mkdir,rmdir
  5. Working with Regular Files    
    • cat
    • rm
    • cp
    • mv
    • cmp
    • wc
  6. File Attributes    
    • chown, chmod, chmod -R, displaying files with ls -l
    • chmod u+, chmod a-w, chmod g+w, chmod -r, chgrp
    • inode, hard link, symbolic link
  7. The Shell    
    • What is shell
    • Different types of shells
    • Wildcards
    • Escaping and Quoting
    • Escaping and Quoting
  8. Redirection Pipes    
    • Input,output and error stream
    • Redirection : > and >>
    • Pipes : |
  9. Working with Linux Process    
    • Process
    • Shell process
    • Process spawning - parent and child process
    • Process attributes - pid, ppid
    • Init Process
    • User process & System process
    • ps with options
  10. The Linux Environment    
    • Environment variable vs Local variables
    • set command
    • env command
    • SHELL, HOME, PATH, LOGNAME, PS1, PS2
    • history
    •  ! and ~
    • alias
  11. Basics of System Administration    
    • Root login-su
    • User management - UID, GID, useradd, usermod, userdel
    • Discs – Du, df
  12. Simple filters    
    • Head
    • tail
    • sort
    • cut
    • paste

Introduction to Linux - Intermediate

  1. The grep command    
    • To see the content of a file
    • To list the entries of a particular stream
    • To ignore cases
    • Lines that do not match the pattern
    • To list the line numbers with the entries
    • To store the result in another file
    • To know the count


  1. Some more on grep command    
    • Search using grep
    • To match more than one pattern
    • To check a word that has different spelling
    • Character class
    • The use of *
    • To match any one character using dot
    • To match a pattern at the beginning of the file
    • To match a pattern at the end of the file


  1. The sed command    
    • stream
    • editor
    • display
    • sed
    • To print using sed
    • Line Addressing
    • Context Addressing


  1. Some more on sed command    
    • substitute
    • insert
    • delete
  1. Basics of awk    
    • Awk Preliminaries
    • Selection criteria
    • action
    • Formatted printing - printf
    • Fields and -F option
    • Regular expressions
    • NR - number of records
    • Variables
  1. Programming with awk    
    • Reading the program from a file (-f)
    • The BEGIN & END section
    • Control Constructs
  1. Advanced features of awk    
    • Array
    • Function
  1. Networking tools    
    • Ping
    • Telnet
    • ftp
    • ssh
    • scp & sftp
  1. Linux Process    
    • Fork
    • Exec
    • Wait
    • Nice
    • Kill with options


  1. More about Linux Process    
    • Cron, crontab

Contributors and Content Editors

Ashwini, Gaurav, Lavitha Pereira, Minal, Nancyvarkey, PoojaMoolya, Pravin1389