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 is the comma to display different lines that are found when compare two files?
What is the use of find command in unix?
What is the difference between grep and grep?
Explain ‘library functions’ with respect to unix commands?
How do I search a whole word in vim?
What is pipe command in unix?
What is grep in bash?
What does the md command do?
Which command is used to delete all files in the current directory and all its sub-directories?
What are file commands?
Explain ‘system calls’ with respect to unix commands?
What does sed command do in unix?
What is ctrl d?
What is awk command used for?
What does find command return in unix?