Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

vi unix how to see later pages and chaange colors

Hi,

In putty vi editor vi unix how to see later pages and change colors for bettwer view.

i open big property file not able to see what is at bottom.

how to search in vi editor for some text sat xyz.

setting i went i changed colors , font etc not reflecting.

what is best setting to give for better view

when i opened
abc.properties in vi
it says 536L, 28390C
what is L what is C
how to know how many lines there how many it is showing etc
can i use winscp free version for production servers viewing property files?
please advise
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

/pattern (search forward for pattern)
?pattern (Search Backward for pattern)

any option to search both backwards and forwards?

L - lines
C - Characters
does it show total number of lines when i do vi on a files say xyz.properties

vi is only showing part of the page how to scroll down to later part of the page or last part of the page or how to go to page number 5
Arrow key down will go down, arrow key right, arrow key up......

See quick reference guide.
Page, 5 presuming 24 lines per page
In read mode, enter 96G
And you'll be 96 lines down from your current position.
Ctrl+g or ctrl+G will tell you your current position.
Avatar of gudii9

ASKER

Arrow key down will go down, arrow key right, arrow key up......

say i want to search on london in file xyz.properties


then i do
vi xyz.properties

once it opens

i do like

?london

then i click enter button right
to find next entry of london i click agin enter button right

i was not clear instead of enter how you click up arrow and down ward arrow?
please advise
Usually, when you open a file, your position is ar the top, searching backwards(?) will find no matches, /London/i will tell it to search for the pattern no matter the case.

grep -I 'london' xyz.properties

You are posting partial information with your question which does not make it clear what gig are after.
If you want to replace all instances of London with Paris
After opening the file you type using the keyboard the following as written ":%s/London/Paris/g"
Once you hit enter all matches of London will be changed Paris including on the same line (g on the end tells it to pergorm the match/replace on all).
: indicates a command to ve run
%s means all line substitution
/ is used as a delimiter between match pattern and replacement pattern.
If the pattern includes / you must escape as follows \/.

Depending on vi/vim if available, when you search, often all matches are "highlighted"
Avatar of gudii9

ASKER

can you give grep on vi editor like below

grep -I 'london' xyz.properties


i do not want to replace anything.

i just want to search on a file different string elements exist or not


as of now i am doing

\london

or
?london

not sure difference between them though
Grep is a shell command that can be run on the file searching for a pattern.

Look a man grep for guidance on its utilization...
Avatar of gudii9

ASKER

Grep is a shell command that can be run on the file searching for a pattern.

my requirement is search in vi editor once i open file there
not before opening file grepping on that file name?
If search within vi, refer to the vi quick guide and prior comments
/pattern