Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How i'll delete a particular line from the file? Please give
answer as soon as possible. Thanks in advance.

Answer Posted / dhanooj

1)open file ,point to that perticular line, give
command "dd"
it will delete the line and save the file by pressing ":wq"
2)grep -v 'string pattern' file > newfile
it will create newfile with all lines from the file
except the lines containing "string pattern"
3)sed "pattern/d" filename >tmpfile
will delete all lines having this pattern and will write
to newfile
4)sed "3,d" filename >tmpfile
will remove the line 3 and will write to tmpfile

Is This Answer Correct ?    21 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are grep patterns?

1153


hw will u use awk in replacing cahrs and files

3298


Explain command to show the space allocation of files?

1170


Explain ‘library functions’ with respect to unix commands?

1217


What is the search command in unix?

1134


How do I run a bash script?

1241


Which unix command lists files/folders in alphabetical order?

1853


What does sed command do in unix?

1250


Describe the usage and functionality of the command rm –r * in unix?

2185


What is s and g in sed command?

1165


Give the command for finding the current date.

1177


Which command is used to create a directory?

1230


What does this command do? Cat food 1 > kitty

1637


why metadb requires a seperate slice to create Solaris volume manager

3253


What is the behavioural difference between cmp and diff commands?

1342