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 size of time_t?
What is the behavioural difference between cmp and diff commands?
What does this command do,"$more readme.txt“?
What is the difference between awk and grep?
Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?
Are you in or at the office?
What is grep in bash?
What is the comma to display different lines that are found when compare two files?
What is a bash command?
Who command in unix?
What is ‘ps’ command for?
Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?
What is the use of find command in unix?
What is awk good for?
How do I search for text in vi?