본문 바로가기
OS 운영체제/LINUX

Linux 디렉토리 구조

by yororing 2024. 3. 20.

 

경로 설명 (간략) 설명 (상)
/ The Root Directory everything on your Linux system is located under the / directory
/bin Essential User Binaries - The /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 -- 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 -- it contains essential system administration binaries
/boot Static Boot Files - contains the files needed to boot the system
- 예) the GRUB boot loader's files and your Linux kernels are stored here. The boot loader's configuration files aren't located here, though -- they're in /etc with the other configuration files
/cdrom Historical Mount Point for CD-ROMs - not part of the FHS standard, but can still be found on Ubuntu and other operating systems
- a temporary location for CD-ROMs inserted in the system
- 주의) the standard location for temporary media is inside the /media directory
/dev Device Files - Linux 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
- 예) /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.
- also contains pseudo-devices (i.e., virtual devices that don't actually correspond to hardware)
- 예) /dev/random produces random numbers
- 예) /dev/null is a special device that produces no output and automatically discards all input -- when you pipe the output of a command to /dev/null, you discard it
/etc Configuration Files - contains 구성 파일들 (configuration files, which can generally be edited by hand in a text editor)
- 주의) contains system-wide configuration files -- user-specific configuration files are located in each user's home directory
/home Home Folders - contains 각 사용자의 home 폴더들 (home folder for each user)
- 예) if your user name is bob, you have a home folder located at /home/bob. This home folder contains the user's 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
/lib Essential Shared Libraries - 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
/lost+found Recovered Files - 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
/media Removable Mdeia - contains subdirectories where removable media devices inserted into the computer are mounted
- 예) 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
/mnt Temporary Mount Points - historically speaking, the /mnt directory is where system administrators mounted temporary file systems while using them
- 예) if you're 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
/opt Optional Packages - contains 부수적인/선택적인 소프트웨어 패키지들의 부디렉토리들 (subdirectories for optional software packages)
- commonly used by proprietary software that doesn't obey the standard file system hierarchy
- 예) a proprietary program might dump its files in /opt/application when you install it
/proc Kernel & Process Files - similar to the /dev directory b/c it doesn't contain standard files
- contains special files that represent system and process info
/root Root Home Directory - the home directory of the root user
- Instead of being located at /home/root, it's located at /root
- distinct from / (i.e., the system root directory)
/run System Administration Binaries - fairly new directory
- stores transient files they require like sockets and process IDs (these files can't be stored in /tmp b/c files in /tmp may be deleted)
/sbin System Administration Binaries - similar to the /bin directory
- contains essential binaries that are generally intended to be run by the root user for system administration
/selinux SELinux Virtual File System - If your Linux distribution uses SELinux for security (Fedora and Red Hat, for example), the /selinux contains special files used by SELinux
- similar to /proc
- Ubuntu doesn't use SELinux, so the presence of this folder on Ubuntu appears to be a bug
/srv Service Data - contains "data for services provided by the system"
- If you were using the Apache HTTP server to serve a website, you'd likely store your website's files in a directory inside the /srv
/tmp Temporary Files - Applications store temporary files in the /tmp (these files are generally deleted whenever your system is restarted and may be deleted at any time by utilities such as tmpwatch)
/usr User Binaries & Read-Only Data - contains applications and files used by users, as opposed to applications and files used by the system
- 예) non-essential applications are located inside /usr/bin instead of /bin
- 예) non-essential system administration binaries are located in /usr/sbin instead of /sbin
- 예) Libraries for each are located inside /usr/lib
- 예) architecture-independent files like graphics are located in /usr/share
- 예) /usr/local directory is where locally compiled applications install to by default -- this prevents them from mucking up the rest of the system
/var Variable Data Files - the writable counterpart to /usr, 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 /var
- 예) log files are in /var/log

 

참조 

  1. https://www.howtogeek.com/117435/htg-explains-the-linux-directory-structure-explained/ 
  2.  
  3.  
  4.  

'OS 운영체제 > LINUX' 카테고리의 다른 글

find (파일 검색 명령어)  (0) 2024.04.05
swap (가상 저장 공간)  (0) 2024.04.04
tar (archive 파일 작업 명령어)  (0) 2024.03.28
scp (서버간 파일 복사 명령어)  (0) 2024.03.20
Environment Variables  (0) 2024.03.18