Difference between revisions of "Linux"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with '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 …')
 
 
(13 intermediate revisions by 5 users not shown)
Line 9: Line 9:
 
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.  
 
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'.  
+
The Spoken Tutorial Effort for Linux has been contributed by Mr. Anirban Roy Choudhury. Other contributors who helped in the creation of the scripts and tutorials include Shahid Ali Farooqui, Shambulingayya, Anusha Kadambala, Anuvrat Parashar, Abhijit Sunil, Prashant Shah, Namita Menezes, Balasubramaniam S.N., Gaurav Shinde, Praveen S., Sachin Patil, Ashwini Patil, DesiCrew Solutions Pvt. Ltd., Nancy Varkey
 +
 
 +
'''Learners''': Anyone who wishes to learn basics of system administration. Absolute must for beginners.  
  
 
<blockquote style="background-color: lemonchiffon; border: solid thin grey;">
 
<blockquote style="background-color: lemonchiffon; border: solid thin grey;">
Line 22: Line 24:
  
 
==Introduction to Linux - Novice==
 
==Introduction to Linux - Novice==
# Getting Started &nbsp; &nbsp;  
+
# Ubuntu desktop &nbsp; &nbsp;  
#* What is Linux
+
#* Ubuntu Desktop
#* Difference between Unix, Linux and GNU
+
#* Main Menu
#* Different Linux Distributions
+
#* System Tray
#* Installation of  Linux from Windows (By Wubi Installer )
+
#* Trash Bin icon (RHS corner)
#* Dual Boot
+
#* Desktop icon (LHS corner), pen-drive
#* The GNOME desktop
+
# Synaptic package manager
#* The terminal window
+
#*Synaptic Package Manager
 +
#*How to install packages
 +
# Ubuntu software system
 +
#*Ubuntu-Software-Center
 +
#*Installing softwares through Ubuntu Software Center
 
# Basic Commands &nbsp; &nbsp;  
 
# Basic Commands &nbsp; &nbsp;  
 
#* Commands with example
 
#* Commands with example
Line 68: Line 74:
 
#* chmod u+, chmod a-w, chmod g+w, chmod -r, chgrp  
 
#* chmod u+, chmod a-w, chmod g+w, chmod -r, chgrp  
 
#* inode, hard link, symbolic link
 
#* inode, hard link, symbolic link
# The Shell &nbsp; &nbsp; 
 
#* What is shell
 
#* Different types of shells
 
#* Wildcards
 
#* Escaping and Quoting
 
#* Escaping and Quoting
 
 
# Redirection Pipes &nbsp; &nbsp;  
 
# Redirection Pipes &nbsp; &nbsp;  
 
#* Input,output and error stream
 
#* Input,output and error stream
Line 106: Line 106:
  
 
==Introduction to Linux - Intermediate==
 
==Introduction to Linux - Intermediate==
# The grep command and Regular Expressions &nbsp; &nbsp;  
+
# The grep command &nbsp; &nbsp;
 +
#* 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
 +
# More on grep command &nbsp; &nbsp;  
 
#* Search using grep
 
#* Search using grep
#* Various options - i,v,n,c,e
+
#* To match more than one pattern
#* Pattern
+
#* To check a word that has different spelling
#* Regular expression - character class, .(dot),  ^, $, extended regular expression
+
#* 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
 
# The sed command &nbsp; &nbsp;  
 
# The sed command &nbsp; &nbsp;  
#* stream
+
#* sed
#* editor
+
#* To print using sed
#* display
+
#* Line Addressing
 +
#* Context Addressing
 +
#More on sed command &nbsp; &nbsp;
 
#* substitute
 
#* substitute
 
#* insert
 
#* insert
 
#* delete
 
#* delete
 +
 +
<!--
 
#Basics of awk &nbsp; &nbsp;  
 
#Basics of awk &nbsp; &nbsp;  
 
#* Awk Preliminaries
 
#* Awk Preliminaries
Line 127: Line 143:
 
#* NR - number of records
 
#* NR - number of records
 
#* Variables
 
#* Variables
# Programming with awk &nbsp; &nbsp;
 
#* Reading the program from a file (-f)
 
#* The BEGIN & END section
 
#* Control Constructs
 
# Advanced features of awk &nbsp; &nbsp;
 
#* Array
 
#* Function
 
# Simple Filters &nbsp; &nbsp;
 
#* grep
 
#* sed
 
#  Basics of Shell Scripting &nbsp; &nbsp;
 
#* variables
 
#* Logical Operators
 
#* Arithmatic Operators -expr,test etc.
 
#* Conditional Construct -if,case etc.
 
#* Looping construct - for,while etc.
 
#* Example script
 
 
# Networking tools &nbsp; &nbsp;  
 
# Networking tools &nbsp; &nbsp;  
 
#* Ping
 
#* Ping
Line 150: Line 149:
 
#* ssh
 
#* ssh
 
#* scp & sftp
 
#* scp & sftp
# More about Linux Process &nbsp; &nbsp;  
+
# Linux Process &nbsp; &nbsp;  
 
#* Fork
 
#* Fork
 
#* Exec
 
#* Exec
Line 156: Line 155:
 
#* Nice
 
#* Nice
 
#* Kill with options
 
#* Kill with options
 +
# More about Linux Process &nbsp; &nbsp;
 
#* Cron, crontab
 
#* Cron, crontab
 
+
-->
==BASH Shell Scripting==
+
# Introduction to BASH Shell Scripting 
+
#*The bash shell
+
#**Bash Shell is a Command language interpreter that executes commands.
+
#**commands are read from input device.
+
#**input can be your keyboard or from a external file. 
+
#*Bash Shell Script
+
#**Series of BASH commands written seqentially in plain text file
+
#*Hello, World! Tutorial
+
#**creating a simple 'hello_world.sh' file using vim editor.
+
#*Shebang [#!/bin/bash]
+
#**The first line of every script is called a shebang.
+
#**It consists of a number sign and an exclamation point character (#!), followed by the full path to the interpreter such as /bin/bash.
+
#*Shell Comments
+
#**adding comments in your BASH programs, to make it more readable using '#'
+
#*echo Statement
+
#**printing a message on the screen using ECHO statement.
+
#*exit status
+
#**terminating your script using EXIT command and returning a numerical value
+
#*Execute a script
+
#**making the script executable using CHMOD command.
+
#*Debug a script
+
#**turning on the debug mode using 'set -x'
+
#*Shell Commands
+
#**Already explained in 'Introduction to linux' section
+
# Basics of Shell Scripting
+
#*Variable in a shell
+
#**System Variable      -These are created and maintained by linux bash shell itself.Commonly used system variables HOSTNAME, HOME, USER.
+
#**User Defined Variables-These variables are created and maintained by users.
+
#*Variable Declaration
+
#**Global variable -By default all the variables are global, i.e their values remains the same in and outside the function. 
+
#**Local variable  -To declare variables locally use local.The syntax is local variable=value
+
#*Getting user input via Keyboard
+
#**We can accept input from the keyboard and assing an input value to a user defined variable using 'read' command.
+
#*Command Line arguments
+
#**A Command line argument is an arguments passed to a program which is been called.
+
#*Quoting
+
#**They are three types of quotes
+
#***1)Double quote
+
#***2)Single quote
+
#***3)Backslash
+
#*Globbing
+
#**Filename expansion carried by BASH is known as Globbing.
+
#*The export statement
+
#**The export command makes available variables to all child processes of the running script or shell
+
# Arrays
+
#*Declaring an array
+
#*Various arrays operation
+
# Conditional execution
+
#*test
+
#*if...then
+
#*if...then...else...if
+
#*nested if
+
#*Multilevel if-then-else
+
#*logical AND
+
#*logical OR
+
#*logical NOT
+
#*Conditional expression using
+
#*Conditional expression using
+
# Bash comparison
+
#*Arithmetic comparison                             
+
#*String comparison                           
+
#*File attributes comparisons
+
# Loops
+
#*The for loop statement             
+
#*Nested for loop statement         
+
#*The while loop statement           
+
#*Use of : to set infinite while loop
+
#*The until loop statement           
+
#*The select loop statement         
+
#*Exit the select loop statement     
+
#*Using the break statement         
+
#*Using the continue statement       
+
# The case statement     
+
#*using case
+
#*creating menus using case
+
#*multiple options in case
+
# Functions
+
#*Writing your first shell function
+
#*Displaying functions             
+
#*Removing functions               
+
#*Defining functions             
+
#*Writing functions             
+
#*Calling functions             
+
#*Pass arguments into a function 
+
#*Local variable                 
+
#*Returning from a function     
+
#*Source command                 
+
#*Recursive function             
+
#*Putting functions in background
+
# Redirections (error handling)
+
#*Input and Output                                   
+
#*Standard input                                     
+
#*Standard output                                   
+
#*Standard error                                     
+
#*Redirection of both standard error and output     
+
#*Appending redirected output                       
+
#*Empty file creation                               
+
#*Here documents                                     
+
#*Here strings                                       
+
#*Assigns the file descriptor (fd) to file for output
+
#*Assigns the file descriptor (fd) to file for input 
+
#*Closes the file descriptor (fd)                             
+
# Pipes and filters
+
#*Linking Commands                   
+
#*Multiple commands                   
+
#*Putting jobs in background         
+
#*Pipes                               
+
#*How to use pipes to connect programs
+
#*Input redirection in pipes         
+
#*Output redirection in pipes         
+
#*Why use pipes                       
+
#*Filters
+
# Signals, process and traps
+
#*Signals                                                 
+
#*What is a Process?                                       
+
#*How to view Processes                                   
+
#*Sending signal to Processes                             
+
#*Terminating Processes                                   
+
#*Shell signal values                                     
+
#*The trap statement                                       
+
#*How to clear trap                                       
+
#*Include trap statements in a script                     
+
#*Use the trap statement to catch signals and handle errors
+
#*What is a Subshell?                                     
+
#*Compound command                                         
+
#*Exec command
+
# Making you shell script interactive (using dialog box)
+
#*Menu driven scripts                         
+
#*Getting information about your system       
+
#*Bash display dialog boxes                   
+
#*Dialog customisation with configuration file
+
#*A yes/no dialog box                         
+
#*An input dialog box                         
+
#*A password box                             
+
#*A menu box                                 
+
#*A progress bar (gauge box)                 
+
#*The form dialog for input
+

Latest revision as of 12:01, 18 October 2021

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 has been contributed by Mr. Anirban Roy Choudhury. Other contributors who helped in the creation of the scripts and tutorials include Shahid Ali Farooqui, Shambulingayya, Anusha Kadambala, Anuvrat Parashar, Abhijit Sunil, Prashant Shah, Namita Menezes, Balasubramaniam S.N., Gaurav Shinde, Praveen S., Sachin Patil, Ashwini Patil, DesiCrew Solutions Pvt. Ltd., Nancy Varkey

Learners: Anyone who wishes to learn basics of system administration. Absolute must for beginners.

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

Introduction to Linux - Novice

  1. Ubuntu desktop    
    • Ubuntu Desktop
    • Main Menu
    • System Tray
    • Trash Bin icon (RHS corner)
    • Desktop icon (LHS corner), pen-drive
  2. Synaptic package manager
    • Synaptic Package Manager
    • How to install packages
  3. Ubuntu software system
    • Ubuntu-Software-Center
    • Installing softwares through Ubuntu Software Center
  4. Basic Commands    
    • Commands with example
    • Command interpreter
    • Shell
    • Using man
    • Apropos
    • Whatis
    • Using --help option
  5. General Purpose Utilities in Linux    
    • echo
    • uname
    • who
    • passwd
    • date
    • cal
    • Brief overview on Files and directories
    • pwd
    • ls
    • cat
  6. File System    
    • File
    • Directory
    • File Inode
    • Types of Files
    • Home directory and Current directory
    • Change Directory(cd)
    • mkdir,rmdir
  7. Working with Regular Files    
    • cat
    • rm
    • cp
    • mv
    • cmp
    • wc
  8. 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
  9. Redirection Pipes    
    • Input,output and error stream
    • Redirection : > and >>
    • Pipes : |
  10. 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
  11. The Linux Environment    
    • Environment variable vs Local variables
    • set command
    • env command
    • SHELL, HOME, PATH, LOGNAME, PS1, PS2
    • history
    •  ! and ~
    • alias
  12. Basics of System Administration    
    • Root login-su
    • User management - UID, GID, useradd, usermod, userdel
    • Discs – Du, df
  13. 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
  2. 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
  3. The sed command    
    • sed
    • To print using sed
    • Line Addressing
    • Context Addressing
  4. More on sed command    
    • substitute
    • insert
    • delete


Contributors and Content Editors

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