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

Windows XP installation, no previous version of Windows NT - Super User

software installation - How to install linux driver for a lb-link wireless usb adapter - Ask Ubuntu

permissions - Mount is denied because the NTFS volume is already exclusively opened - Ask Ubuntu