SlideShare a Scribd company logo
VI editor
AGENDA
» WHAT IS VI EDITOR?
» HISTORY OF VI.
» CHARACTERISTIC OF VI.
» STARTING VI
» MODE IN VI EDITOR.
» COMMON VI COMMAND
» HOW TO EXIT FROM VI
HELLO!
1.
WHAT IS VI
» The visual editor on the Linux.
» The vi editor comes with every version of Linux or Unix.
» Using vi is similar to using other editors in that you can see your file on the
screen ..
» The vi editor is the most popular editor in linux. The current version is
» really "vim", but to invoke it simply type "vi".
» Before vi the primary editor used on Unix was the line editor
⋄ - User was able to see/edit only one line of the text at a time
» The vi editor is not a text formatter (like MS Word, Word Perfect, etc.)
⋄ - you cannot set margins
⋄ - center heading
⋄ - Etc…”
» Although other stories exist, the true one tells that vi was originally written
» by Bill Joy in 1976.
» Who is Bill Joy you ask?
- He co-founded Sun Microsystems in 1982
and served as chief scientist until 2003.
The vi editor is:
» - A very powerful
» - It is hard to learn, specially for windows
users
» - Move from point to point in the file, and
make changes.
» - Available on all UNIX systems
Vi modes
» - Command mode
⋄ - Accessed by typing Esc
⋄ - In this mode all the keys pressed by the user are interpret to the editor command.
» - Input mode
⋄ - Accessed by typing “i”
⋄ - This mode permits insertion of new text, editing of existing text or replacement of existing text.
» Ex mode( Last Line Mode)
⋄ -The bottom line of the vi screen is called ex mode.
⋄ - When you start vi by default it is in command mode
» -You exit the input mode by pressing the Esc key to get back to the command mode.
There are three modes in vi
I/P & O/P
REDIRECTION
Most Linux commands read input, such as a file or another
attribute for the command, and write output. By default,
input is being given with the keyboard, and output is
displayed on your screen.
Your keyboard is your standard
input (stdin) device, and the screen or a particular terminal
window is the standard output (stdout) device.
However, since Linux is a flexible system, these
default settings don't necessarily have to be applied. The
standard output, for example, on a heavily monitored
server in a large environment may be a printer.
Output redirection with > and Input
redirection with <
The> operator tells unix, “Don’t display this output on screen instead , put it
somewhere else”. Likewise the < operator says “ the input for this command is not
coming from the keyboard this time look for somewhere else”.
The somewhere else can be a file or a printer for output redirection and a
file or a keyboard for input redirection.
Example
$cat file1 > file2
$cat test1
some words
$ cat test2
some other words
$ cat test1 test2 > test3
$cat test3
some words some other words
Example
$cat file1 < file2
$cat < test3
some words
some other words
Example
Sometime we may use both the redirection operators at once as
shown below
$ cat < currentfile > newfile
input is taken fron currentfile and output is stored in
newfile
$ cat < currentfile > newfile
is also same
Example
Another redirection operator is
>>
Example
$who >> logfile
it is similar to > except if the target
file already existing the new output is append to its end
This command append current users who have
logged in to the end of logfile
PIPING
COMMAND 1
COMMAND
2
COMMAND
3
Quite often a single unix command is not suffice to solve a
problem or do a task. That’s the time we can try joining
command together. The chief tools for this are redirection and
piping.
The unix piping facility lets us to connect commands to other commands. It
can be really useful to redirect the output of one program so that it became
the input of another program. Incidentally such commands are known as
filters.
Thus a filter is a program which can receive a flow of data from standard
input, process it and send the results to the standard output.
 cat concatenates and display file
More display a file one screen full at atime
Grep searches file for pattern
Sort sorts and merges file
Wc count lines, words and characters
Unique reports repeated lines in file
EXAPMLE
1. $LS | WC –L
Output of ls becomes the input of wc
2. $ ls | wwc –l > countfile

More Related Content

What's hot

Autotools
AutotoolsAutotools
Autotools
Vibha Singh
 
Linux commands part4
Linux commands part4Linux commands part4
Linux commands part4
bhatvijetha
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell script
Kenny (netman)
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
VIKAS TIWARI
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
John Ombagi
 
Linux commands part3
Linux commands part3Linux commands part3
Linux commands part3
bhatvijetha
 
One Click Ownage
One Click OwnageOne Click Ownage
One Click Ownage
Ferruh Mavituna
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
shanmuga rajan
 
Mastering unix
Mastering unixMastering unix
Mastering unix
Raghu nath
 
Linux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls commandLinux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls command
bhatvijetha
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
ismailaboshatra
 
Shell programming
Shell programmingShell programming
Shell programming
Moayad Moawiah
 
Cheatsheet: Metasploit
Cheatsheet: MetasploitCheatsheet: Metasploit
Cheatsheet: Metasploit
Kasper de Waard
 
Linux Run Level
Linux Run LevelLinux Run Level
Linux Run Level
Gaurav Mishra
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUXBASIC COMMANDS OF LINUX
Linux file commands
Linux file commandsLinux file commands
Linux file commands
sundas Shabbir
 
Shell Script Tutorial
Shell Script TutorialShell Script Tutorial
Shell Script Tutorial
Quang Minh Đoàn
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Nguyen Vinh
 
unix-OS-Lab-4.doc
unix-OS-Lab-4.docunix-OS-Lab-4.doc
unix-OS-Lab-4.doc
ismailaboshatra
 
Linux monitoring
Linux monitoringLinux monitoring
Linux monitoring
Mark Veltzer
 

What's hot (20)

Autotools
AutotoolsAutotools
Autotools
 
Linux commands part4
Linux commands part4Linux commands part4
Linux commands part4
 
Linux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell scriptLinux fundamental - Chap 14 shell script
Linux fundamental - Chap 14 shell script
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
Linux commands part3
Linux commands part3Linux commands part3
Linux commands part3
 
One Click Ownage
One Click OwnageOne Click Ownage
One Click Ownage
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Mastering unix
Mastering unixMastering unix
Mastering unix
 
Linux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls commandLinux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls command
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
 
Shell programming
Shell programmingShell programming
Shell programming
 
Cheatsheet: Metasploit
Cheatsheet: MetasploitCheatsheet: Metasploit
Cheatsheet: Metasploit
 
Linux Run Level
Linux Run LevelLinux Run Level
Linux Run Level
 
BASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUXBASIC COMMANDS OF LINUX
BASIC COMMANDS OF LINUX
 
Linux file commands
Linux file commandsLinux file commands
Linux file commands
 
Shell Script Tutorial
Shell Script TutorialShell Script Tutorial
Shell Script Tutorial
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
unix-OS-Lab-4.doc
unix-OS-Lab-4.docunix-OS-Lab-4.doc
unix-OS-Lab-4.doc
 
Linux monitoring
Linux monitoringLinux monitoring
Linux monitoring
 

Similar to Vi and redirection & piping in linux

Foss manual (1)
Foss manual (1)Foss manual (1)
Foss manual (1)
Janagi Raman S
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction to  Command LineChapter 1: Introduction to  Command Line
Chapter 1: Introduction to Command Line
azzamhadeel89
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction  to Command LineChapter 1: Introduction  to Command Line
Chapter 1: Introduction to Command Line
azzamhadeel89
 
Linuxppt
LinuxpptLinuxppt
Nithi
NithiNithi
Nithi
sharmibalu
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
LinuxpptLinuxppt
Linuxppt
Reka
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
rajikaa
 
02 linux desktop usage
02 linux desktop usage02 linux desktop usage
02 linux desktop usage
Shay Cohen
 
Unix t2
Unix t2Unix t2
Unix t2
Raafat younis
 
UNIX.ppt
UNIX.pptUNIX.ppt
UNIX.ppt
DivyaKS18
 
Basic linux day 4
Basic linux day 4Basic linux day 4
Basic linux day 4
Saikumar Daram
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
Jim Birch
 
Unix final
Unix finalUnix final
Unix final
MahakKasliwal
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
MahakKasliwal
 
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxPart 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
karlhennesey
 
Linux programming - Getting self started
Linux programming - Getting self started Linux programming - Getting self started
Linux programming - Getting self started
Emertxe Information Technologies Pvt Ltd
 
Linux Basics.pptx
Linux Basics.pptxLinux Basics.pptx
Linux Basics.pptx
RanjitKumarPanda5
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginners
Nitesh Nayal
 
Vim Book
Vim BookVim Book
Vim Book
Maurício Sousa
 

Similar to Vi and redirection & piping in linux (20)

Foss manual (1)
Foss manual (1)Foss manual (1)
Foss manual (1)
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction to  Command LineChapter 1: Introduction to  Command Line
Chapter 1: Introduction to Command Line
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction  to Command LineChapter 1: Introduction  to Command Line
Chapter 1: Introduction to Command Line
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Nithi
NithiNithi
Nithi
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
 
02 linux desktop usage
02 linux desktop usage02 linux desktop usage
02 linux desktop usage
 
Unix t2
Unix t2Unix t2
Unix t2
 
UNIX.ppt
UNIX.pptUNIX.ppt
UNIX.ppt
 
Basic linux day 4
Basic linux day 4Basic linux day 4
Basic linux day 4
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 
Unix final
Unix finalUnix final
Unix final
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxPart 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
 
Linux programming - Getting self started
Linux programming - Getting self started Linux programming - Getting self started
Linux programming - Getting self started
 
Linux Basics.pptx
Linux Basics.pptxLinux Basics.pptx
Linux Basics.pptx
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginners
 
Vim Book
Vim BookVim Book
Vim Book
 

Recently uploaded

Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
Mahmoud Morsy
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
IJECEIAES
 
integral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdfintegral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdf
gaafergoudaay7aga
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 

Recently uploaded (20)

Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
 
integral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdfintegral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdf
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 

Vi and redirection & piping in linux

  • 2. AGENDA » WHAT IS VI EDITOR? » HISTORY OF VI. » CHARACTERISTIC OF VI. » STARTING VI » MODE IN VI EDITOR. » COMMON VI COMMAND » HOW TO EXIT FROM VI
  • 5. » The visual editor on the Linux. » The vi editor comes with every version of Linux or Unix. » Using vi is similar to using other editors in that you can see your file on the screen .. » The vi editor is the most popular editor in linux. The current version is » really "vim", but to invoke it simply type "vi". » Before vi the primary editor used on Unix was the line editor ⋄ - User was able to see/edit only one line of the text at a time » The vi editor is not a text formatter (like MS Word, Word Perfect, etc.) ⋄ - you cannot set margins ⋄ - center heading ⋄ - Etc…” » Although other stories exist, the true one tells that vi was originally written » by Bill Joy in 1976. » Who is Bill Joy you ask? - He co-founded Sun Microsystems in 1982 and served as chief scientist until 2003.
  • 6. The vi editor is: » - A very powerful » - It is hard to learn, specially for windows users » - Move from point to point in the file, and make changes. » - Available on all UNIX systems
  • 8. » - Command mode ⋄ - Accessed by typing Esc ⋄ - In this mode all the keys pressed by the user are interpret to the editor command. » - Input mode ⋄ - Accessed by typing “i” ⋄ - This mode permits insertion of new text, editing of existing text or replacement of existing text. » Ex mode( Last Line Mode) ⋄ -The bottom line of the vi screen is called ex mode. ⋄ - When you start vi by default it is in command mode » -You exit the input mode by pressing the Esc key to get back to the command mode. There are three modes in vi
  • 10. Most Linux commands read input, such as a file or another attribute for the command, and write output. By default, input is being given with the keyboard, and output is displayed on your screen. Your keyboard is your standard input (stdin) device, and the screen or a particular terminal window is the standard output (stdout) device. However, since Linux is a flexible system, these default settings don't necessarily have to be applied. The standard output, for example, on a heavily monitored server in a large environment may be a printer.
  • 11. Output redirection with > and Input redirection with < The> operator tells unix, “Don’t display this output on screen instead , put it somewhere else”. Likewise the < operator says “ the input for this command is not coming from the keyboard this time look for somewhere else”. The somewhere else can be a file or a printer for output redirection and a file or a keyboard for input redirection.
  • 12. Example $cat file1 > file2 $cat test1 some words $ cat test2 some other words $ cat test1 test2 > test3 $cat test3 some words some other words
  • 13. Example $cat file1 < file2 $cat < test3 some words some other words
  • 14. Example Sometime we may use both the redirection operators at once as shown below $ cat < currentfile > newfile input is taken fron currentfile and output is stored in newfile $ cat < currentfile > newfile is also same
  • 15. Example Another redirection operator is >> Example $who >> logfile it is similar to > except if the target file already existing the new output is append to its end This command append current users who have logged in to the end of logfile
  • 17. Quite often a single unix command is not suffice to solve a problem or do a task. That’s the time we can try joining command together. The chief tools for this are redirection and piping. The unix piping facility lets us to connect commands to other commands. It can be really useful to redirect the output of one program so that it became the input of another program. Incidentally such commands are known as filters. Thus a filter is a program which can receive a flow of data from standard input, process it and send the results to the standard output.
  • 18.  cat concatenates and display file More display a file one screen full at atime Grep searches file for pattern Sort sorts and merges file Wc count lines, words and characters Unique reports repeated lines in file
  • 19. EXAPMLE 1. $LS | WC –L Output of ls becomes the input of wc 2. $ ls | wwc –l > countfile