Linux Director Structure

One of the most troubling starting points that new Linux users have to get over are where things are kept. The Linux directory structure may seem odd at first, especially to windows users.
Here’s a brief list of the major directories and what they are for.

(forward slash) This is the root directory. The mothership. The home filed. The one and only top directory for your whole computer. Everything, and I mean EVERYTHING starts here. When you type ‘/home’ what you are really saying is “start at / and then go the home directory.”

(/root) This is where the root user lives. The root user is the god of your system. Root can do anything, upto and including removing your entire filesystem. So be careful using root.

(/bin) Here is where your standard Linux utilities (read programs) live – thing like “ls” and “vi” and “more”. Generally this directory is included in your path. What this means is that if you type ‘ls’, /bin is one of the places your shell will look to see if ‘ls’ means anything.

(/etc) Here is where the administrative and system configuration stuff lives. For instance, if you have samba installed, and you want to modify the samba configuration files, you did find them in /etc/samba.

(/dev) Here is where files that control peripherals live. Talking to a printer? Your computer is doing it from here. Some goes for disk drives, USB devices, and other such stuff.

(/home) Here is where your data is stored. Config files specific to users, your desktop folder (which makes your desktop what it is), and any data related to your user. Each user will have their own /home/username folder, with the exception of the root user.

(/tmp) This is the temporary folder. Think of it as a scratch directory for your Linux System. Files that would not be needed by programs once their used once or twice are put here. Many Linux system are set to automatically wipe the /tmp folder at certain intervals, so do not put things you want to keep here.

(/usr) Here is where you will find extra utilities that do not fit under /bin or /etc. Things like games, printer utilities, and whatnot. /usr is divided into sections like /usr/bin for programs, /usr/share for shared data like sound files or icons, /usr/lib for libraries which cannot be directly run but are essential for running other programs. Your package manager takes care of the things in /usr for you.

(/opt) Here is where optional stuff is put. Trying out the latest Firefox beta? Install it to /opt where you can delete it without affecting other settings. Programs in here usually live inside a single folder which contains all of their data, libraries, etc.

(/media) Use this folder to mount things like USB disks, CD or DVD drives and other filesystems.

(/boot) This directory holds static files used by the boot loader, including kernel images. On systems where kernel development activity occurs regularly, making /boot a separate partition eliminates the possibility that / will fill with kernel images and associated files during development.

(/lib) The directory /lib contains the libraries that are used by programs in the directories /bin and /sbin. The kernel modules (hardware drivers not compiled into the kernel) are located in the directory /lib/modules/.

(/mnt) The standard directory for integrating file systems is /mnt. It should only be used for temporary purposes. For permanent mounts, you should create an appropriately named directory.

(/proc) Linux handles process information that is made available to users via the directory /proc. This directory does not contain any real files and therefore does not occupy any space on the hard disk. It is generated dynamically when it is accessed (for example, with ls /proc). Each process has its own directory. The values in these directories can be read as if they were in a file. Some values can also be set by writing to the corresponding “files”. Changes to this virtual file system only have an effect as long as the system is running.

(/sbin) The directory /sbin contains important programs for system administration. Programs that are run by normal users as well are located in /bin. Programs in the directory /sbin can also, as a rule, be run by normal users, but only to display the configured values. Changes to the configuration can only be made by the user root.

(/srv) The directory /srv contains subdirectories designed for containing data of various services. For example, the files of the Apache web server are located in the directory /srv/www/ and the FTP server files are located in the directory /srv/ftp/.

(/sys) The directory /sys provides information in the form of a tree structure on various hardware buses, hardware devices, active devices, and their drivers.

(/var) This directory and its subdirectories contain files that can be modified while the system is running.

Now you can consider youself one step to a master linux user. these directories, while at first a little confusing, will become second nature to you after a bit of use


Popular posts from this blog

How to create Oracle stored Procedures using TOAD for Oracle

How to Create Packages in Oracle Database using TOAD for Oracle

Create Tables in Oracle Database using TOAD