Solved

How delete particular line with out opening file?

Posted on 2008-06-18
2
720 Views
Last Modified: 2013-12-27
How delete particular line with out opening file,say i want to delete line number 2 in a file with out using vi.
0
Comment
Question by:umeshexp
  • 2
2 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 125 total points
ID: 21814382
try

sed '2 d' file > file.$$
mv file.$$ file
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 21814852
why B grade :|
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now