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

Who command in unix operating system?

1188


Which unix command lists files/folders in alphabetical order?

1846


What are the differences among a system call, a library function, and a unix command?

1267


Differentiate cmp command from diff command.

1233


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

1319


Which command is used to delete all files in the current directory and all its sub-directories?

1316


Explain the steps that a shell follows while processing a command.

1283


Name the general commands in using unix os for a beginner?

1213


What are grep patterns?

1146


What is .sh file?

1256


Which command can you use to find the currently running process in unix server?

1163


How do you grep recursively?

1152


Write a command that will display files in the current directory, in a colored, long format.

1270


What is the use of find command in unix?

1209


How does shebang work?

1120