Q) write grep commands to select the lines that have exactly two characters

Ans):- grep “^..$” filename

Q) what is the difference between SED and GREP ? Which one is more better and why?

Ans):-
Both serves the purpose of “pattern matching” in files.SED has more features compared to simple GREP.
Ex: like replacement of existing string with new string. Deleting the lines in a file etc

Q): what is the difference between KILL and KILL -9?

Ans):- Kill allows the child processes to be killed before parent process is killed. Kill -9 forcefully kills the process without giving time to child processes to be killed. In IPC architecture, it’s not good idea to kill forcefully using “-9” option.

Q) How to display a file name which has zero bytes in size.
Ans)- we can find using find command.
find / -size 0
This will print all files under / which has 0 size.