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


Please Help Members By Posting Answers For Below Questions

Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

650


What is the first character of the output in ls l command?

637


Which command is used to copy files?

562


What is nr in awk command?

611


What difference between cmp and diff commands?

729






Which command can you use to find the currently running process in unix server?

592


Describe the zip/unzip command using gzip.

615


Which unix command to make a new directory?

594


What is {} in find command?

584


What are the general commands in using unix os for a beginner?

583


What do chmod command do?

606


What is command statement?

543


What is the function of grep command in unix?

594


How does the system know where one command ends and another begins?

1582


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 # include int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

1768