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

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User