What does this command do (find / -name gcc 2>/dev/null)? - Ask Ubuntu
what command find / -name gcc 2>/dev/null do?
let's break better understanding:
find / -name gcc searches through root dir (the / dir, contains /etc, /home , forth) file name gcc. search done recursively, meaning subdirectories, sub-subdirectories , on searched well.
the > operator redirects output. in case, 2> redirects output of standard channel error messages, stderr. 
ls > the_list.txt # writes output of ls file ls 2> the_list.txt # writes output of ls on stderr file /dev/null pseudo device throws away gets written it. can use if have write stuff somewhere, want gone. 
so ls > /dev/null means "redirect output of ls /dev/null", or "don't bother me output". above, ls 2>/dev/null sends what's written on stderr /dev/null.
the complete command
find / -name gcc 2>/dev/null therefore means "search on whole system file called gcc, don't show me error messages occur while doing so".
Comments
Post a Comment