Linux directory structure

Have you ever looked in your / directory, you’ll see a lot of directories. Here we are presenting beginners guide to linux directory structure explaining what they mean and what are the contents of these directories.

Screenshot of contents of root directory:

linux directory structure

 

/

This is called root partition. All files and directories start with root partition. Write privileges under this directory are avaible with root user only. Not to confuse it with root user’s home directory, know the difference, “/” is root partition while root user’s home directory is “/root”.

/bin

This directory has binary executable files. Linux commands used in single user mode are found in this directory. It also holds commands that are used by all users. Examples: ls, ping, cp.

/sbin

Like /bin, /sbin also contains binary executable files but the commands held by this directory are used by system administrators with the prime purpose of system maintenance. Examples: iptables, reboot, fdisk.

/etc

It holds all the configuration files which are required by all programs. Shell scripts needed by programs to start or stop them are held by this very directory. Examples are /etc/resolv.conf, /etc/logrotate.conf

/dev

/dev contains device files. In Linux, everything is a file. Included are terminal device or usb or any other device connected to the computer. For example: /dev/usbmon0

/proc

All the system process information is held in /proc. It is a pseudo filesystem as it contains information about running processes. For an instance, /proc/ is the directory which holds information of the process with . It contains information about the system resources. /proc/uptime is one such directory.

/var

var denotes variable files. Those files are kept in this directory that are supposed to grow. Some of the files that reside in here are- /var/log (system log files), /var/lib (package files), /var/mail (emails), /var/spool (print queues), /var/tmp (temporary files that are needed across reboots).

/tmp

System generated and user generated temporary files are kept in this category. Important files should not be saved in here because contents of /tmp are flushed every time system boots.

/usr

/usr is the one that holds user programs. It contains documentations, libraries and source-code for all the second level applications. /usr/bin holds binaries for user programs. While looking for a binary after /bin also look in /usr/bin. Examples of binaries you mighht find in /usr/bin are awk, less, cc. Similarly binary files for system administrators are kept in /usr/sbin. Examples are cron, sshd, useradd. Libraries for /usr/bin and /usr/sbin are kept in /usr/lib. /usr/local holds user programs that a user installs from source.

/home

All user’s personal files are kept in their respective home directories.

/boot

This directory has boot loader files. While booting, files needed are found in /boot. Kernel initrd, grub and few more files reside in this directory.

/lib

Binaries located in /bin and /sbin are supported by library files kept in /lib. Library nomenclature goes like ld* or lib*.so.* . For example: ld-2.11.1.so

/opt

/opt is for add-on optional applications from individual vendors. All applications that are optional should be installed in /opt or any of its subdirectory.

/mnt

/mnt is our mount directory. It is the temporary mount location where where system administrators can mount temporary filesystems.

/media

It serves as the temporary mount point for removable devices. All removable devices are mounted in this directory. Example: /media/cdrom or /media/floppy.

/srv

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值