Some operation in RedHat

1. How to delete a range of line in vi, say from line 150 to 250 ?
2. How to cp a directory (include subfolders and files) ?
AXISHKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Seth SimmonsSr. Systems AdministratorCommented:
How to delete a range of line in vi, say from line 150 to 250 ?

put the cursor at line 150 and type d250G

How to cp a directory (include subfolders and files) ?

use -r
example:  cp -r foo /bar
0
AXISHKAuthor Commented:
Any special meaning for G in the command above ?

One more check, how to block a few words in a line and copy it to another place in vi ?

Tks again.
0
Seth SimmonsSr. Systems AdministratorCommented:
Any special meaning for G in the command above ?

it won't execute until you hit G; just doing d with the line number will just sit there

how to block a few words in a line and copy it to another place in vi ?

use v (manually select text) or V (entire lines)
then y to copy or d to cut
p to paste at the cursor or P to paste before the cursor
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

AXISHKAuthor Commented:
Try to remove those lines but it return error:

E488: Trailing characters..

Any idea ?

Tks
0
Seth SimmonsSr. Systems AdministratorCommented:
what kind of text is in there?
0
AXISHKAuthor Commented:
0
Seth SimmonsSr. Systems AdministratorCommented:
i just took that text and removed lines 150-250 in vi with no problem
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Tks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.