{"id":12834,"date":"2019-03-28T23:07:39","date_gmt":"2019-03-28T23:07:39","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12834"},"modified":"2019-03-28T23:07:39","modified_gmt":"2019-03-28T23:07:39","slug":"linux-directory-structure-and-important-files-paths-explained","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/linux-directory-structure-and-important-files-paths-explained\/","title":{"rendered":"Linux Directory Structure and Important Files Paths Explained"},"content":{"rendered":"<p>For any person, who does not have a sound\u00a0knowledge of\u00a0<strong>Linux Operating System<\/strong>\u00a0and\u00a0<strong>Linux File System<\/strong>, dealing with the files and their location, their use may be horrible, and a newbie may really mess up.<\/p>\n<p>This article is aimed to provide the information about\u00a0<strong>Linux File System<\/strong>, some of the\u00a0<strong>important files<\/strong>, their\u00a0<strong>usability<\/strong>\u00a0and\u00a0<strong>location<\/strong>.<\/p>\n<h3>Linux Directory Structure Diagram<\/h3>\n<p>A standard\u00a0<strong>Linux<\/strong>\u00a0distribution follows the directory structure as provided below with Diagram and explanation.<\/p>\n<div id=\"attachment_4156\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/linux-directory-structure-and-important-files-paths-explained\/linux-directory-structure\/\" rel=\"attachment wp-att-4156\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4156\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/09\/Linux-Directory-Structure.jpeg\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/09\/Linux-Directory-Structure.jpeg 640w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/09\/Linux-Directory-Structure-554x450.jpeg 554w\" alt=\"Linux File System Structure\" width=\"640\" height=\"519\" aria-describedby=\"caption-attachment-4156\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-4156\" class=\"wp-caption-text\">Linux Directory Structure<\/p>\n<\/div>\n<p>Each of the above directory (which is a file, at the first place) contains important information, required for booting to device drivers, configuration files, etc. Describing briefly the purpose of each directory, we are starting hierarchically.<\/p>\n<ol>\n<li><strong>\/bin<\/strong>\u00a0: All the executable binary programs (file) required during booting, repairing, files required to run into single-user-mode, and other important, basic commands\u00a0<strong>viz.<\/strong>,\u00a0<a href=\"https:\/\/www.tecmint.com\/13-basic-cat-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">cat<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/check-linux-disk-usage-of-files-and-directories\/\" target=\"_blank\" rel=\"noopener\">du<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-check-disk-space-in-linux\/\" target=\"_blank\" rel=\"noopener\">df<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/18-tar-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">tar<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/20-practical-examples-of-rpm-commands-in-linux\/\" target=\"_blank\" rel=\"noopener\">rpm<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/wc-command-examples\/\" target=\"_blank\" rel=\"noopener\">wc,\u00a0<\/a><a href=\"https:\/\/www.tecmint.com\/history-command-examples\/\" target=\"_blank\" rel=\"noopener\">history<\/a>, etc.<\/li>\n<li><strong>\/boot<\/strong>\u00a0: Holds important files during\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-boot-process\/\" target=\"_blank\" rel=\"noopener\">boot-up process<\/a>, including\u00a0<strong>Linux Kernel<\/strong>.<\/li>\n<li><strong>\/dev<\/strong>\u00a0: Contains device files for all the hardware devices on the machine e.g.,\u00a0<strong>cdrom<\/strong>,\u00a0<strong>cpu<\/strong>, etc<\/li>\n<li><strong>\/etc<\/strong>\u00a0: Contains Application\u2019s configuration files,\u00a0<strong>startup<\/strong>,\u00a0<strong>shutdown<\/strong>,\u00a0<strong>start<\/strong>,\u00a0<strong>stop<\/strong>\u00a0script for every individual program.<\/li>\n<li><strong>\/home<\/strong>\u00a0: Home directory of the users. Every time a new user is created, a directory in the name of user is created within home directory which contains other directories like\u00a0<strong>Desktop<\/strong>,\u00a0<strong>Downloads<\/strong>,\u00a0<strong>Documents<\/strong>, etc.<\/li>\n<li><strong>\/lib<\/strong>\u00a0: The Lib directory contains\u00a0<strong>kernel modules<\/strong>\u00a0and\u00a0<strong>shared library<\/strong>\u00a0images required to boot the system and run commands in root file system.<\/li>\n<li><strong>\/lost+found<\/strong>\u00a0: This Directory is installed during installation of\u00a0<strong>Linux<\/strong>, useful for recovering files which may be broken due to unexpected\u00a0<strong>shut-down<\/strong>.<\/li>\n<li><strong>\/media<\/strong>\u00a0: Temporary mount directory is created for removable devices viz.,\u00a0<strong>media\/cdrom<\/strong>.<\/li>\n<li><strong>\/mnt<\/strong>\u00a0: Temporary mount directory for\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-mount-and-unmount-an-iso-image-in-linux\/\" target=\"_blank\" rel=\"noopener\">mounting file system<\/a>.<\/li>\n<li><strong>\/opt<\/strong>\u00a0: Optional is abbreviated as opt. Contains third party application software. Viz.,\u00a0<a href=\"https:\/\/www.tecmint.com\/install-jdk-jre-on-rhe-centos-6-5-and-fedora-17-12\/\" target=\"_blank\" rel=\"noopener\">Java<\/a>, etc.<\/li>\n<li><strong>\/proc<\/strong>\u00a0: A virtual and pseudo file-system which contains information about\u00a0<strong>running process<\/strong>\u00a0with a particular\u00a0<strong>Process-id<\/strong>\u00a0aka\u00a0<strong>pid<\/strong>.<\/li>\n<li><strong>\/root<\/strong>\u00a0: This is the home directory of root user and should never be confused with\u00a0<strong>\u2018\/<\/strong>\u2018<\/li>\n<li><strong>\/run<\/strong>\u00a0: This directory is the only clean solution for\u00a0<strong>early-runtime-dir<\/strong>\u00a0problem.<\/li>\n<li><strong>\/sbin<\/strong>\u00a0: Contains binary executable programs, required by\u00a0<strong>System Administrator<\/strong>, for\u00a0<strong>Maintenance<\/strong>. Viz.,\u00a0<a href=\"https:\/\/www.tecmint.com\/basic-guide-on-iptables-linux-firewall-tips-commands\/\" target=\"_blank\" rel=\"noopener\">iptables<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/fdisk-commands-to-manage-linux-disk-partitions\/\" target=\"_blank\" rel=\"noopener\">fdisk<\/a>,\u00a0<a href=\"https:\/\/www.tecmint.com\/ifconfig-command-examples\/\" target=\"_blank\" rel=\"noopener\">ifconfig<\/a>, swapon, reboot, etc.<\/li>\n<li><strong>\/srv<\/strong>\u00a0: Service is abbreviated as \u2018<strong>srv<\/strong>\u2018. This directory contains server specific and service related files.<\/li>\n<li><strong>\/sys<\/strong>\u00a0: Modern Linux distributions include a\u00a0<strong>\/sys<\/strong>\u00a0directory as a\u00a0<strong>virtual filesystem<\/strong>, which stores and allows modification of the devices connected to the system.<\/li>\n<li><strong>\/tmp<\/strong>\u00a0:System\u2019s Temporary Directory, Accessible by users and root. Stores temporary files for\u00a0<strong>user<\/strong>\u00a0and\u00a0<strong>system<\/strong>, till next boot.<\/li>\n<li><strong>\/usr<\/strong>\u00a0: Contains executable\u00a0<strong>binaries<\/strong>,\u00a0<strong>documentation<\/strong>,\u00a0<strong>source code<\/strong>,\u00a0<strong>libraries<\/strong>\u00a0for second level program.<\/li>\n<li><strong>\/var<\/strong>\u00a0: Stands for variable. The contents of this file is expected to grow. This directory contains\u00a0<strong>log<\/strong>,\u00a0<strong>lock<\/strong>,\u00a0<strong>spool<\/strong>,\u00a0<strong>mail<\/strong>\u00a0and\u00a0<strong>temp<\/strong>\u00a0files.<\/li>\n<\/ol>\n<p><strong>Linux<\/strong>\u00a0is a complex system which requires a more complex and efficient way to\u00a0<strong>start<\/strong>,\u00a0<strong>stop<\/strong>,\u00a0<strong>maintain<\/strong>\u00a0and\u00a0<strong>reboot<\/strong>a system unlike\u00a0<strong>Windows<\/strong>. There is a well defined configuration\u00a0<strong>files<\/strong>,\u00a0<strong>binaries<\/strong>,\u00a0<strong>man pages<\/strong>,\u00a0<strong>info files<\/strong>, etc. for every\u00a0<strong>process<\/strong>\u00a0in\u00a0<strong>Linux<\/strong>.<\/p>\n<ol>\n<li><strong>\/boot\/vmlinuz<\/strong>\u00a0: The\u00a0<strong>Linux Kernel<\/strong>\u00a0file.<\/li>\n<li><strong>\/dev\/hda<\/strong>\u00a0: Device file for the first\u00a0<strong>IDE HDD<\/strong>\u00a0(<strong>Hard Disk Drive<\/strong>)<\/li>\n<li><strong>\/dev\/hdc<\/strong>\u00a0: Device file for the\u00a0<strong>IDE Cdrom<\/strong>, commonly<\/li>\n<li><strong>\/dev\/null<\/strong>\u00a0: A pseudo device, that don\u2019t exist. Sometime garbage output is redirected to\u00a0<strong>\/dev\/null<\/strong>, so that it gets lost, forever.<\/li>\n<li><strong>\/etc\/bashrc<\/strong>\u00a0: Contains system\u00a0<strong>defaults<\/strong>\u00a0and\u00a0<strong>aliases<\/strong>\u00a0used by bash shell.<\/li>\n<li><strong>\/etc\/crontab<\/strong>\u00a0: A\u00a0<a href=\"https:\/\/www.tecmint.com\/category\/bash-shell\/\" target=\"_blank\" rel=\"noopener\">shell script<\/a>\u00a0to run specified commands on a predefined time Interval.<\/li>\n<li><strong>\/etc\/exports<\/strong>\u00a0: Information of the file system available on\u00a0<strong>network<\/strong>.<\/li>\n<li><strong>\/etc\/fstab<\/strong>\u00a0: Information of\u00a0<strong>Disk Drive<\/strong>\u00a0and their mount point.<\/li>\n<li><strong>\/etc\/group<\/strong>\u00a0: Information of\u00a0<strong>Security Group<\/strong>.<\/li>\n<li><strong>\/etc\/grub.conf<\/strong>\u00a0: grub\u00a0<strong>bootloader<\/strong>\u00a0configuration file.<\/li>\n<li><strong>\/etc\/init.d<\/strong>\u00a0: Service\u00a0<strong>startup<\/strong>\u00a0Script.<\/li>\n<li><strong>\/etc\/lilo.conf<\/strong>\u00a0: lilo\u00a0<strong>bootloader<\/strong>\u00a0configuration file.<\/li>\n<li><strong>\/etc\/hosts<\/strong>\u00a0: Information of\u00a0<strong>Ip addresses<\/strong>\u00a0and corresponding\u00a0<strong>host names<\/strong>.<\/li>\n<li><strong>\/etc\/hosts.allow<\/strong>\u00a0: List of\u00a0<strong>hosts allowed<\/strong>\u00a0to access services on the local machine.<\/li>\n<li><strong>\/etc\/host.deny<\/strong>\u00a0: List of\u00a0<strong>hosts denied<\/strong>\u00a0to access services on the local machine.<\/li>\n<li><strong>\/etc\/inittab<\/strong>\u00a0: INIT process and their interaction at various<strong>\u00a0run level<\/strong>.<\/li>\n<li><strong>\/etc\/issue<\/strong>\u00a0: Allows to edit the\u00a0<strong>pre-login<\/strong>\u00a0message.<\/li>\n<li><strong>\/etc\/modules.conf<\/strong>\u00a0: Configuration files for\u00a0<strong>system modules<\/strong>.<\/li>\n<li><strong>\/etc\/motd<\/strong>\u00a0:\u00a0<a href=\"https:\/\/www.tecmint.com\/protect-ssh-logins-with-ssh-motd-banner-messages\/\" target=\"_blank\" rel=\"noopener\">motd<\/a>\u00a0stands for\u00a0<strong>Message Of The Day<\/strong>, The Message users gets upon login.<\/li>\n<li><strong>\/etc\/mtab<\/strong>\u00a0: Currently mounted\u00a0<strong>blocks<\/strong>\u00a0information.<\/li>\n<li><strong>\/etc\/passwd<\/strong>\u00a0: Contains\u00a0<strong>password<\/strong>\u00a0of system\u00a0<strong>users<\/strong>\u00a0in a shadow file, a security implementation.<\/li>\n<li><strong>\/etc\/printcap<\/strong>\u00a0:\u00a0<strong>Printer<\/strong>\u00a0Information<\/li>\n<li><strong>\/etc\/profile<\/strong>\u00a0: Bash shell\u00a0<strong>defaults<\/strong><\/li>\n<li><strong>\/etc\/profile.d<\/strong>\u00a0: Application script, executed after\u00a0<strong>login<\/strong>.<\/li>\n<li><strong>\/etc\/rc.d<\/strong>\u00a0: Information about\u00a0<strong>run level<\/strong>\u00a0specific script.<\/li>\n<li><strong>\/etc\/rc.d\/init.d<\/strong>\u00a0: Run Level\u00a0<strong>Initialisation<\/strong>\u00a0Script.<\/li>\n<li><strong>\/etc\/resolv.conf<\/strong>\u00a0: Domain Name Servers (<strong>DNS<\/strong>) being used by System.<\/li>\n<li><strong>\/etc\/securetty<\/strong>\u00a0: Terminal List, where\u00a0<strong>root<\/strong>\u00a0login is possible.<\/li>\n<li><strong>\/etc\/skel<\/strong>\u00a0: Script that populates new user\u00a0<strong>home<\/strong>\u00a0directory.<\/li>\n<li><strong>\/etc\/termcap<\/strong>\u00a0: An\u00a0<strong>ASCII<\/strong>\u00a0file that defines the behaviour of\u00a0<strong>Terminal<\/strong>,\u00a0<strong>console<\/strong>\u00a0and\u00a0<strong>printers<\/strong>.<\/li>\n<li><strong>\/etc\/X11<\/strong>\u00a0: Configuration files of\u00a0<strong>X-window<\/strong>\u00a0System.<\/li>\n<li><strong>\/usr\/bin<\/strong>\u00a0: Normal user\u00a0<strong>executable<\/strong>\u00a0commands.<\/li>\n<li><strong>\/usr\/bin\/X11<\/strong>\u00a0: Binaries of\u00a0<strong>X windows<\/strong>\u00a0System.<\/li>\n<li><strong>\/usr\/include<\/strong>\u00a0: Contains include files used by \u2018<strong>c<\/strong>\u2018 program.<\/li>\n<li><strong>\/usr\/share<\/strong>\u00a0: Shared directories of\u00a0<strong>man files<\/strong>,\u00a0<strong>info files<\/strong>, etc.<\/li>\n<li><strong>\/usr\/lib<\/strong>\u00a0: Library files which are required during program\u00a0<strong>compilation<\/strong>.<\/li>\n<li><strong>\/usr\/sbin<\/strong>\u00a0: Commands for\u00a0<strong>Super User<\/strong>, for System Administration.<\/li>\n<li><strong>\/proc\/cpuinfo<\/strong>\u00a0:\u00a0<strong>CPU<\/strong>\u00a0Information<\/li>\n<li><strong>\/proc\/filesystems<\/strong>\u00a0: File-system\u00a0<strong>Information<\/strong>\u00a0being used currently.<\/li>\n<li><strong>\/proc\/interrupts<\/strong>\u00a0: Information about the current\u00a0<strong>interrupts<\/strong>\u00a0being utilised currently.<\/li>\n<li><strong>\/proc\/ioports<\/strong>\u00a0: Contains all the\u00a0<strong>Input<\/strong>\/<strong>Output<\/strong>\u00a0addresses used by devices on the server.<\/li>\n<li><strong>\/proc\/meminfo<\/strong>\u00a0:\u00a0<strong>Memory Usages<\/strong>\u00a0Information.<\/li>\n<li><strong>\/proc\/modules<\/strong>\u00a0: Currently using\u00a0<strong>kernel<\/strong>\u00a0module.<\/li>\n<li><strong>\/proc\/mount<\/strong>\u00a0: Mounted\u00a0<strong>File-system<\/strong>\u00a0Information.<\/li>\n<li><strong>\/proc\/stat<\/strong>\u00a0: Detailed<strong>\u00a0Statistics<\/strong>\u00a0of the current System.<\/li>\n<li><strong>\/proc\/swaps<\/strong>\u00a0:\u00a0<strong>Swap<\/strong>\u00a0File Information.<\/li>\n<li><strong>\/version<\/strong>\u00a0: Linux\u00a0<strong>Version<\/strong>\u00a0Information.<\/li>\n<li><strong>\/var\/log\/lastlog<\/strong>\u00a0: log of last\u00a0<strong>boot<\/strong>\u00a0process.<\/li>\n<li><strong>\/var\/log\/messages<\/strong>\u00a0: log of messages produced by\u00a0<strong>syslog<\/strong>\u00a0daemon at boot.<\/li>\n<li><strong>\/var\/log\/wtmp<\/strong>\u00a0: list login\u00a0<strong>time<\/strong>\u00a0and\u00a0<strong>duration<\/strong>\u00a0of each user on the system currently.<\/li>\n<\/ol>\n<p>That\u2019s all for now.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/linux-directory-structure-and-important-files-paths-explained\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For any person, who does not have a sound\u00a0knowledge of\u00a0Linux Operating System\u00a0and\u00a0Linux File System, dealing with the files and their location, their use may be horrible, and a newbie may really mess up. This article is aimed to provide the information about\u00a0Linux File System, some of the\u00a0important files, their\u00a0usability\u00a0and\u00a0location. Linux Directory Structure Diagram A standard\u00a0Linux\u00a0distribution &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/linux-directory-structure-and-important-files-paths-explained\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Linux Directory Structure and Important Files Paths Explained&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12834","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12834"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12834\/revisions"}],"predecessor-version":[{"id":12835,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12834\/revisions\/12835"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}