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 a bash command?
Why is awk called awk?
What's a command word?
What is grep command in unix with examples?
Write a command to kill the last background job?
When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system.
How can i findthe right soluion???
My pgm:
#include
How do I open a port?
Which command can you use to find the currently running process in unix server?
What is rmdir command?
why metadb requires a seperate slice to create Solaris volume manager
Can you enlist some commonly used network commands?
What does the “echo” command do?
What are awk commands?
What does 'mkdir' command do in UNIX?
What is “chmod” command?