{"id":609,"date":"2016-05-27T12:42:54","date_gmt":"2016-05-27T11:42:54","guid":{"rendered":"http:\/\/www.balajibandi.com\/?p=609"},"modified":"2018-01-27T12:47:38","modified_gmt":"2018-01-27T12:47:38","slug":"ubuntu-linux-directory-structure","status":"publish","type":"post","link":"https:\/\/www.balajibandi.com\/?p=609","title":{"rendered":"Ubuntu  Linux Directory Structure"},"content":{"rendered":"<h1><span style=\"text-decoration: underline;\"><span style=\"color: #3366ff;\"><strong>Ubuntu Linux Directory Structure<\/strong><\/span><\/span><\/h1>\n<p id=\"PzSIanU\"><img loading=\"lazy\" decoding=\"async\" width=\"733\" height=\"509\" class=\"alignnone size-full wp-image-610 \" src=\"http:\/\/www.balajibandi.com\/wp-content\/uploads\/2018\/01\/img_5a6c749c6fe01.png\" alt=\"\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2018\/01\/img_5a6c749c6fe01.png 733w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2018\/01\/img_5a6c749c6fe01-300x208.png 300w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/p>\n<p>If you\u2019re coming from Windows, the Linux file system structure can seem particularly alien. The C:\\ drive and drive letters are gone, replaced by a \/ and cryptic-sounding directories, most of which have three letter names.<\/p>\n<p>&nbsp;<\/p>\n<p>The Filesystem Hierarchy Standard (FHS) defines the structure of file systems on Linux and other UNIX-like operating systems. However, Linux file systems also contain some directories that aren\u2019t yet defined by the standard.<\/p>\n<p>\/ \u2013 The Root Directory<\/p>\n<p>Everything on your Linux system is located under the \/ directory, known as the root directory. You can think of the \/ directory as being similar to the C:\\ directory on Windows \u2013 but this isn\u2019t strictly true, as Linux doesn\u2019t have drive letters. While another partition would be located at D:\\ on Windows, this other partition would appear in another folder under \/ on Linux.<\/p>\n<p>\/bin \u2013 Essential User Binaries<br \/>\nThe \/bin directory contains the essential user binaries (programs) that must be present when the system is mounted in single-user mode. Applications such as Firefox are stored in \/usr\/bin, while important system programs and utilities such as the bash shell are located in \/bin. The \/usr directory may be stored on another partition \u2013 placing these files in the \/bin directory ensures the system will have these important utilities even if no other file systems are mounted. The \/sbin directory is similar \u2013 it contains essential system administration binaries.<\/p>\n<p>\/boot \u2013 Static Boot Files<br \/>\nThe \/boot directory contains the files needed to boot the system \u2013 for example, the GRUB boot loader\u2019s files and your Linux kernels are stored here. The boot loader\u2019s configuration files aren\u2019t located here, though \u2013 they\u2019re in \/etc with the other configuration files.<\/p>\n<p>\/cdrom \u2013 Historical Mount Point for CD-ROMs<br \/>\nThe \/cdrom directory isn\u2019t part of the FHS standard, but you\u2019ll still find it on Ubuntu and other operating systems. It\u2019s a temporary location for CD-ROMs inserted in the system. However, the standard location for temporary media is inside the \/media directory.<\/p>\n<p>\/dev \u2013 Device Files<br \/>\nLinux exposes devices as files, and the \/dev directory contains a number of special files that represent devices. These are not actual files as we know them, but they appear as files \u2013 for example, \/dev\/sda represents the first SATA drive in the system. If you wanted to partition it, you could start a partition editor and tell it to edit \/dev\/sda.<\/p>\n<p>This directory also contains pseudo-devices, which are virtual devices that don\u2019t actually correspond to hardware. For example, \/dev\/random produces random numbers. \/dev\/null is a special device that produces no output and automatically discards all input \u2013 when you pipe the output of a command to \/dev\/null, you discard it.<\/p>\n<p>\/etc \u2013 Configuration Files<br \/>\nThe \/etc directory contains configuration files, which can generally be edited by hand in a text editor. Note that the \/etc\/ directory contains system-wide configuration files \u2013 user-specific configuration files are located in each user\u2019s home directory.<\/p>\n<p>\/home \u2013 Home Folders<br \/>\nThe \/home directory contains a home folder for each user. For example, if your user name is bob, you have a home folder located at \/home\/bob. This home folder contains the user\u2019s data files and user-specific configuration files. Each user only has write access to their own home folder and must obtain elevated permissions (become the root user) to modify other files on the system.<\/p>\n<p>\/lib \u2013 Essential Shared Libraries<br \/>\nThe \/lib directory contains libraries needed by the essential binaries in the \/bin and \/sbin folder. Libraries needed by the binaries in the \/usr\/bin folder are located in \/usr\/lib.<\/p>\n<p>\/lost+found \u2013 Recovered Files<br \/>\nEach Linux file system has a lost+found directory. If the file system crashes, a file system check will be performed at next boot. Any corrupted files found will be placed in the lost+found directory, so you can attempt to recover as much data as possible.<\/p>\n<p>\/media \u2013 Removable Media<br \/>\nThe \/media directory contains subdirectories where removable media devices inserted into the computer are mounted. For example, when you insert a CD into your Linux system, a directory will automatically be created inside the \/media directory. You can access the contents of the CD inside this directory.<\/p>\n<p>\/mnt \u2013 Temporary Mount Points<br \/>\nHistorically speaking, the \/mnt directory is where system administrators mounted temporary file systems while using them. For example, if you\u2019re mounting a Windows partition to perform some file recovery operations, you might mount it at \/mnt\/windows. However, you can mount other file systems anywhere on the system.<\/p>\n<p>\/opt \u2013 Optional Packages<br \/>\nThe \/opt directory contains subdirectories for optional software packages. It\u2019s commonly used by proprietary software that doesn\u2019t obey the standard file system hierarchy \u2013 for example, a proprietary program might dump its files in \/opt\/application when you install it.<\/p>\n<p>\/proc \u2013 Kernel &amp; Process Files<br \/>\nThe \/proc directory similar to the \/dev directory because it doesn\u2019t contain standard files. It contains special files that represent system and process information.<\/p>\n<p>\/root \u2013 Root Home Directory<br \/>\nThe \/root directory is the home directory of the root user. Instead of being located at \/home\/root, it\u2019s located at \/root. This is distinct from \/, which is the system root directory.<\/p>\n<p>\/run \u2013 Application State Files<br \/>\nThe \/run directory is fairly new, and gives applications a standard place to store transient files they require like sockets and process IDs. These files can\u2019t be stored in \/tmp because files in \/tmp may be deleted.<\/p>\n<p>\/sbin \u2013 System Administration Binaries<br \/>\nThe \/sbin directory is similar to the \/bin directory. It contains essential binaries that are generally intended to be run by the root user for system administration.<\/p>\n<p>\/selinux \u2013 SELinux Virtual File System<br \/>\nIf your Linux distribution uses SELinux for security (Fedora and Red Hat, for example), the \/selinux directory contains special files used by SELinux. It\u2019s similar to \/proc. Ubuntu doesn\u2019t use SELinux, so the presence of this folder on Ubuntu appears to be a bug.<\/p>\n<p>\/srv \u2013 Service Data<br \/>\nThe \/srv directory contains \u201cdata for services provided by the system.\u201d If you were using the Apache HTTP server to serve a website, you\u2019d likely store your website\u2019s files in a directory inside the \/srv directory.<\/p>\n<p>\/tmp \u2013 Temporary Files<br \/>\nApplications store temporary files in the \/tmp directory. These files are generally deleted whenever your system is restarted and may be deleted at any time by utilities such as tmpwatch.<\/p>\n<p>\/usr \u2013 User Binaries &amp; Read-Only Data<br \/>\nThe \/usr directory contains applications and files used by users, as opposed to applications and files used by the system. For example, non-essential applications are located inside the \/usr\/bin directory instead of the \/bin directory and non-essential system administration binaries are located in the \/usr\/sbin directory instead of the \/sbin directory. Libraries for each are located inside the \/usr\/lib directory. The \/usr directory also contains other directories \u2013 for example, architecture-independent files like graphics are located in \/usr\/share.<\/p>\n<p>The \/usr\/local directory is where locally compiled applications install to by default \u2013 this prevents them from mucking up the rest of the system.<\/p>\n<p>\/var \u2013 Variable Data Files<br \/>\nThe \/var directory is the writable counterpart to the \/usr directory, which must be read-only in normal operation. Log files and everything else that would normally be written to \/usr during normal operation are written to the \/var directory. For example, you\u2019ll find log files in \/var\/log.<\/p>\n<p>Good Luck ..happy labbiiiing !!!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu Linux Directory Structure If you\u2019re coming from Windows, the Linux file system structure can seem particularly alien. The C:\\ drive and drive letters are gone, replaced by a \/ and cryptic-sounding directories, most of which have three letter names. &nbsp; The Filesystem Hierarchy Standard (FHS) defines the structure of file systems on Linux and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-609","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=609"}],"version-history":[{"count":1,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/609\/revisions"}],"predecessor-version":[{"id":611,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/609\/revisions\/611"}],"wp:attachment":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}