Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was wondering if some could say what the main things the directories like usr,var,etc, bin... contain.
I know var is logs and stuff and that etc has to do with things involving users and groups and stuff, but overall I feel I don't know these things well enough.
File System Layout
The first noticeable difference between Slackware Linux and a DOS or Windows system is the filesystem. For starters, we do not use drive letters to denote different partitions. Under Linux, there is one main directory. You can relate this to the C: drive under DOS. Each partition on your system is mounted to a directory on the main directory. It's kind of like an ever-expanding hard disk.
We call the main directory the root directory, and it's denoted with a single slash (/). This concept may seem strange, but it actually makes life easy for you when you want to add more space. For example, let's say you run out of space on the drive that has /home on it. Most people install Slackware and make one big root drive. Well, since a partition can be mounted to any directory, you can simply go to the store and pick up a new hard drive and mount it to /home. You've now “grafted” on some more space to your system. And all without having to move many things around.
Below, you will find descriptions of the major top level directories under Slackware.
/bin
Essential user programs are stored here. These represent the bare minimum set of programs required for a user to use the system. Things like the shell and the filesystem commands (ls, cp, and so on) are stored here. The /bin directory usually doesn't receive modification after installation. If it does, it's usually in the form of package upgrades that we provide.
/boot
Files that are used by the Linux Loader (LILO). This directory also receives little modification after an installation.
/cdrom
Remember that all drives have to be mounted to a directory on the main root directory? Well, /cdrom is provided as a mount point for your CD-ROM drive.
/dev
Everything in Linux is treated as a file, even hardware devices like serial ports, hard disks, and scanners. In order to access these devices, a special file called a device node has to be present. All device nodes are stored in the /dev directory. You will find this to be true across many UNIX-like operating systems.
/etc
This directory holds system configuration files. Everything from the X Window configuration file, the user database, to the system startup scripts. The system administrator will become quite familiar with this directory over time.
/home
Linux is a multiuser operating system. Each user on the system is given an account and a unique directory for personal files. This directory is called the user's “home” directory. The /home directory is provided as the default location for user home directories.
/lib
System libraries that are required for basic operation are stored here. The C library, the dynamic loader, the ncurses library, and kernel modules are among the things stored here.
/lost+found
When the system boots, the filesystems are checked for any errors. If errors are detected, the fsck program is run to see if any can be corrected. The corrected parts of the filesystem are written to the /lost+found directory.
/mnt
This directory is provided as a temporary mount point for working on hard disks or removable drives.
/opt
Optional software packages. The idea behind /opt is that each software package installs to /opt/<software package>, which makes it easy to remove later. Slackware distributes some things in /opt (such as KDE in /opt/kde), but you are free to add anything you want to /opt.
/proc
This is a unique directory. It's not really part of the filesystem, but a virtual filesystem that provides access to kernel information. Various pieces of information that the kernel wants you to know are conveyed to you through “files” in the /proc directory. You can also send information to the kernel through some of these “files”. Try doing cat /proc/cpuinfo.
/root
The system administrator is known as “root” on the system. root's home directory is kept in /root instead of /home/root. The reason is simple. What if /home was a different partition from / and it could not be mounted? root would naturally want to log in and repair the problem. If his home directory was on the damaged filesystem, it would make it difficult for him to log in.
/sbin
Essential programs that are run by root and during the system bootup process are kept here. Normal users will not run programs in this directory.
/tmp
The temporary storage location. All users have read and write access to this directory.
/usr
This is the big directory on a Linux system. Everything else pretty much goes here, programs, documentation, the kernel source code, and the X Window system. This is the directory to which you will most likely be installing programs.
/var
System log files, cache data, and program lock files are stored here. This is the directory for frequently-changing data.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.