How will you list only the empty lines in a file (using
grep)?

Answers were Sorted based on User's Feedback



How will you list only the empty lines in a file (using grep)?..

Answer / guest

grep "^$" filename

Is This Answer Correct ?    23 Yes 3 No

How will you list only the empty lines in a file (using grep)?..

Answer / junhua

sed -n '/^$/p' file

Is This Answer Correct ?    11 Yes 3 No

How will you list only the empty lines in a file (using grep)?..

Answer / meeran

awk '/^$/' filename

Is This Answer Correct ?    7 Yes 2 No

How will you list only the empty lines in a file (using grep)?..

Answer / kiran penujuri

find . -size 0 -print

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More Shell Script Interview Questions

How to include comments in your shell scripts?

3 Answers  


What is batch file programming?

0 Answers  


What is "test"? How it is used in shell scripting?

2 Answers  


What language is bash written in?

0 Answers  


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

0 Answers  






What are filters explain sort with all the options available?

0 Answers  


1.Write a script, which converts a number from binary to hexadecimal format or vice versa.

1 Answers   ADP,


What is the difference between running a script as ./scriptname.sh and sh scriptname.sh

1 Answers  


Is cmd a shell?

0 Answers  


Write a shell script to get current date, time, user name and current working directory.

0 Answers  


How do I open the shell in cmd?

0 Answers  


What is a shell made of?

0 Answers  


Categories