Posts

Showing posts from 2018

Introduction to vi

Introduction to vi Usually, the actual program installed on your system is vim , which stands for vi Improved , and is aliased to the name vi . When using  vi , all commands are entered through the keyboard; you do not need to keep moving your hands to use a pointer device such as a mouse or touchpad, unless you want to do so when using one of the graphical versions of the editor. vimtutor Typing vimtutor  launches a short but very comprehensive tutorial for those who want to learn their first vi  commands. This tutorial is a good place to start learning vi . Modes in vi vi provides three modes , as described in the table below. It is vital to not lose track of which mode you are in. Many keystrokes and commands behave quite differently in different modes. Mode Feature Command ·       By default, vi  starts in   Command mode. ·       Each key is an editor comma...
Getting Started:  Useful awk programs are often short, just a line or two. Suppose you have a file called emp.data that contains the name, pay rate in nrs per hour, and number of hours worked for your employees, one employee record per line, like this: Ramesh       4.00          0 Samjhana   3.75           0 Asmita        4.00           10 Sandesh      5.00           20 Rajesh         4.25           18 Now you want to print the name and pay (rate times hours) for everyone who worked more than zero hours. This is the kind of job that awk is meant for, so it's easy. prakash@prakash-VPCEB490X:~/Desktop$ awk ' $3 > 0 { print $ 1, ...