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

How do I run a bash script?

797


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

769


What does grep v do?

750


What is unix command?

857


What does the command ' $who | sort –logfile > newfile' do?

1007






Differentiate cat command from more command.

763


How many unix commands are there?

805


What is the command to find hidden files in the current directory?

818


What is command statement?

772


What are filter commands in unix?

759


What is awk good for?

787


Why is awk called awk?

764


What does 'mkdir' command do in UNIX?

889


What is updatedb?

758


Which command is used to find whether the system is 32 bit or 64 bit?

810