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

Hi All, Is it possible to create one file name only space or space in file name in UNIX and we can able to run that on Unix?

2 Answers   Cap Gemini,


How to print pid of the current shell?

0 Answers  


how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

0 Answers  


How will you schedule a job that will run every month last day?(some months have 30 days,some 31 days,28,29 days)

1 Answers   NTT Data, TCS,


How do I run a shell script in powershell?

0 Answers  






Why we are writting shell scripts? Plz if possible explain it briefly.

6 Answers   ITC Infotech,


What is the difference between scripting and coding?

0 Answers  


c program to display the information of given file similar to givan by the unix or linux command ls -l

0 Answers   IBM,


How to print all the arguments provided to the script?

0 Answers  


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

1 Answers  


How will you emulate wc –l using awk?

0 Answers  


Why should we use shell scripts?

0 Answers  


Categories