Krishna Logo
qa training in canada now
Divied
Call: Anusha @ 1 (877) 864-8462

 

Latest News
Home Navigation Divied
INTERVIEW Navigation Divied UNIX INTERVIEW QUESTIONS Navigation Divied What is /dev/null?
What Is /dev/null?
What is /dev/null?

 

 
Ans: It is a black hole. For example, in the earlier example, if you want to ignore error like "sh: cd: Temp: No such file or directory" being printed, you can redirect your output to /dev/null. For example
1 $ cd temp > /dev/null 2>&1 && echo $(Pwd)
 
Will fail silently and nothing will be printed if there is no "temp" folder. The message has gone into the black hole. If there is a "temp" folder, the present working directory (i.e. Pwd) will be printed out.
 
 

Shadow Bottom
 
 
© 2005 -