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
What are the dos commands?
What is difference between grep and find command in unix?
What will the following command do?
What does the metacharacter mean?
What do know about tee command?
Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?
What are reported commands?
Why is grep called grep?
What is the use of finger command?
Enlist some filename manipulation commands in unix.
Explain command to show the space allocation of files?
what is the advaantage of each user having its own copy of the shell?
What command is used to switching between users in unix?
Does cp command overwrite files?
why metadb requires a seperate slice to create Solaris volume manager