There are a lot of folders in the
/ directory what do they all do?
I know a few like
/dev has links to devices in the system but what about
/proc I just am curious.
The official reference for this on Linux is the Filesystem Hierarchy Standard. Distributions mostly follow the FHS (currently at version 3.0), but can occasionally deviate. Other Unix variants have many similarities but again can deviate. There is also a good summary on Wikipedia.
I'll summarize the role of each directory that is found on typical Linux installations. See the FHS or Wikipedia for more details about the role of each directory.
/bin: system programs meant for every user. See also
/boot: files used to start up the system: typically a bootloader, a kernel image, and a few associated files. These files are mostly not accessed after booting.
/dev: device files. These are the ways applications communicate with hardware and more generally with kernel features that are about shuffling data around, such as disk partitions, terminals including virtual ones, etc.
/etc: system configuration files. (So named because it started out as “stuff that didn't fit in the other directories”, but nowadays it's exclusively for configuration files on Linux and mostly if not exclusively for configuration files on other Unix variants. Miscellaneous stuff is now under
/home: the directory containing users' home directories. E.g. Alice's files are typically under
/home/alice. On systems with many users, the administrator may choose to have more levels (e.g.
/home/students/bob, …). A few sites have home directories at a different location such as
/libcontains shared libraries. See also
Some distributions have other directories such as
/lib64to store libraries for different processor architectures.
/lost+found: for files recovered from filesystem corruption (but you're rarely so lucky).
/media: contains mount points for removable media. On some systems, the mount points are at a third level, under directories named after users.
/mnt: There used to be a dispute as to whether
/mntshould be a directory that's available to the system administrator as a temporary mount point, or whether it should be a directory where the administrator can create subdirectories to be used as mount points. Nowadays the first position has won, and
/mediaplays the second role.
/opt: contains additional software with one subdirectory per software package. Some distributions use it heavily, others not at all.
/proc: contains one subdirectory per process, exposing various information about the processes. That's where tools such as
topget their information. Not present on all Unix variants (BSD tends not to have it). On Linux,
/procalso contains information about the system in general, but see also
/sys. Content in
/procis generated on the fly by the kernel when an application reads it.
/root: the root user's home directory. Not present on all systems; traditionally root's home directory was
/run: an in-memory filesystem containing system files that don't need to be preserved upon reboots, such as information about running services. There are typically per-user directories under
/run/user. This is a Linux thing.
/sbin: system programs meant only for administrators. See also
/srv: sort of like
/home, but for system services. A creation of the FHS that hasn't been universally adopted.
/proc, but presents information about kernel drivers and about hardware (the use of
/procfor non-process-related information is deprecated but files that were in
/procfor backward compatibility). Specific to Linux.
/tmp: temporary files, accessible by every user. This is often an in-memory filesystem.
/usr: This is where most of the software is installed.
/usrcontains subdirectories such as
/sbin(but usually not
/etc). The distinction is that the subdirectories of
/contain essential files needed while the system is starting, and
/usrcontains all the rest.
/usrexists separately because there were reasons to keep it on a separate filesystem (which could be read-only, and shared between multiple machines) but the distinction is not always relevant, and less and less so as time goes on, so e.g.
/bincan be a symbolic link to
/usr/binor vice versa. The name comes from “user” but it has been a very long time since
/usrhad anything to do with users, today
/usrcontains system files and that's that.
/var: contains files that tend to change over time, in contrast with
/usrwhich contains files that don't change except when upgrading or installing software. Unlike
/tmp, the files under
/varare (for the most part) meant to be preserved if the system reboots.
/varis pretty diverse: it contains caches, metadata about installed software, printer spools, system mail, log files, temporary files (like
/var/tmpis always preserved upon reboot and usually has more space), etc.
With / being the root, the others are as follows
Note Some of these depend on your distribution
/bin: Essential binaries (programs or executables)
/boot: Boot files, i.e., all the required items for GRUB (or other) boot loader
/cdrom(depends on your distro): Mount point for CD / DVD drive
/dev: Device files, these files represent (they are actually real files) devices physically (or virtually) attached
/etc: Configuration files
/home: home folders for users
/lib: shared libraries for installed binaries
/lost+found: Recovered files that the kernel (or some binary) tried to rescue
/media: removable media
/mnt: mount location (but you can mount anywhere)
/opt: optional packages you want to install that dont make sense to live elsewhere (though this is an arguable point)
/proc: Kernel and process files. Similar to /dev.
/root: root user home directory
/run: application files save their state here when they are running
/sbin: More binaries (mainly for
/selinux: if using SELinux (Centos, Redhat Enterprise, etc), contains special files used by SELinux
/srv: data directory for services, e.g., a web server might use this to store files to 'serve'
/tmp: temp files
/usr: User binaries
/var: log files in /var/log and other data files. generally relates to /usr binaries
(Paraphrased a little)