Search code examples
terminalzsh

What is 'dev' folder when using zsh


I'm currently using macOSX and I just installed oh-my-zsh for using customized UI like 'robbyrussell'

After using zsh, I ran across some folder called 'dev' - full absolute path is /dev

it wasn't exist in '/' until I've used in just normal terminal ( not zsh )

What is 'dev' folder for?


Solution

  • dev is short for devices. On Unix systems (MacOS is a derivate of UNIX via NextStep and BSD) /dev contains file representations of peripheral devices (disks, keyboards, terminals, etc.) and pseudo-devices (random number generators (/dev/random, /dev/urandom), Null-file (/dev/null), etc.).

    Have a look at the hier manpage (man 7 hier) for some information on the filesystem hierarchy.

    I am not sure why /dev would not have shown up before. It is usually hidden in Finder but should be visible in the terminal, no matter which shell.