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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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
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.
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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

E488: Trailing characters..

Any idea ?

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

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
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.