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
Who command in unix operating system?
Which unix command lists files/folders in alphabetical order?
What are the differences among a system call, a library function, and a unix command?
Differentiate cmp command from diff command.
Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.
Which command is used to delete all files in the current directory and all its sub-directories?
Explain the steps that a shell follows while processing a command.
Name the general commands in using unix os for a beginner?
What are grep patterns?
What is .sh file?
Which command can you use to find the currently running process in unix server?
How do you grep recursively?
Write a command that will display files in the current directory, in a colored, long format.
What is the use of find command in unix?
How does shebang work?