How delete particular line with out opening file?

How delete particular line with out opening file,say i want to delete line number 2 in a file with out using vi.
umeshexpAsked:
Who is Participating?
 
omarfaridCommented:
try

sed '2 d' file > file.$$
mv file.$$ file
0
 
omarfaridCommented:
why B grade :|
0
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.

All Courses

From novice to tech pro — start learning today.