Sunday, August 14, 2016

Unix Important command which will Defiantly help you .....:)

Unix Important command which will Defiantly help you .....:)


Give the Numbring in VI:
:se nu

How to find duplicate:-
/name


vi Find And Replace Text Command


:%s/FindMe/ReplaceME/g


 Find and Replace with Confirmation

:%s/UNIX/Linux/gc


Find and Replace Whole Word Only

:%s/\/Linux/gc

Case Insensitive Find and Replace

:%s/unix/Linux/gi

How Do I Replace In the Current Line Only?
:s/UNIX/Linux/g
How Do I Replace All Lines Between line 100 and line 250?
:100,200s/UNIX/Linux/gc


Some Vi Control :-
0 or | Positions cursor at beginning of line.
$ Positions cursor at end of line.
w Positions cursor to the next word.
b Positions cursor to previous word.
( Positions cursor to beginning of current sentence.
) Positions cursor to beginning of next sentence.
E Move to the end of Blank delimited word
{ Move a paragraph back
} Move a paragraph forward
[[ Move a section back
]] Move a section forward
n| Moves to the column n in the current line
1G Move to the first line of the file
G Move to the last line of the file
nG Move to nth line of the file
:n Move to nth line of the file
fc Move forward to c
Fc Move back to c
H Move to top of screen
nH Moves to nth line from the top of the screen
M Move to middle of screen
L Move to botton of screen
nL Moves to nth line from the bottom of the screen
:x Colon followed by a 


The basic syntax of AWK:

awk 'BEGIN {start_action} {action} END {stop_action}' filename

 awk '{print $1}' input_file

Here $1 has a meaning. $1, $2, $3... represents the first, second, third columns... in a row respectively.




1. Cursor Navigation (if your arrow keys dont work on that old Sun box....)
JNext line
KPrevious line
HLeft
LRight
Shift+GBottom of document
GGTop of document
▲ up
minus2. Fast Search
/Search Term
NNext
NPrevious
▲ up
minus3. Command Mode
:enter command mode
:wwrite
:qquit
:q!quit without saving
:wqWrite and quit
ZZWrite and quit
:e open
Escescape command mode
▲ up
minus4. From Normal to Edit Mode
IInsert at current position
IInsert at start of line
AAppend to end of line
OInsert Line Below
OInsert Line Above
SDelete character at current position and insert
SDelete the current line and insert
▲ up

minus5. Clipboard
dwdelete word
dddelete line
Pput after cursor
Pput before cursor
ywcopy word
yycopy line

2 comments:

  1. Great stuff provided by the Admin here… look into this for Obiee online training

    ReplyDelete
  2. Hi,this is Very Nice information Regarding your Software Company and Beautiful Blog Also. So Np compete Also one of the Ios, Android, Java, Devops, UX, Ui, Chat Bot, Company in ChennaiIf you want any job Regarding above Positions,, Please give to Your Queries and send your Resume Back to this mail: sales@npcompete.com

    ReplyDelete

Data engineering Interview Questions

1)  What all challenges you have faced and how did you overcome from it? Ans:- Challenges Faced and Overcome As a hypothetical Spark develop...