Skip to Content

ディレクトリのレイアウト

ディレクトリ構造の概要

/ ├── bin → Essential user commands ├── boot → Boot files ├── dev → Device files ├── etc → System configuration ├── home → User home directories ├── lib → System library files ├── media → Auto-mount points ├── mnt → Manual mount points ├── opt → Third-party software ├── proc → Process information (virtual) ├── root → Root user home directory ├── run → Runtime data ├── sbin → System administration commands ├── srv → Service data ├── sys → Kernel device information (virtual) ├── tmp → Temporary files ├── usr → User-level programs and data └── var → Variable data

詳細な説明

/etc — システム構成ファイル

ほぼすべてのシステム サービスの構成ファイルを保存します。

/etc/ ├── apt/ # APT package manager configuration │ └── sources.list.d/ # Software source configuration ├── default/grub # GRUB bootloader configuration ├── fstab # Disk mount configuration ├── hostname # Hostname ├── hosts # Local DNS mapping ├── NetworkManager/ # Network management configuration ├── nginx/ # Nginx configuration (if installed) ├── passwd # User account information ├── shadow # User passwords (encrypted) ├── ssh/ # SSH server configuration ├── sudoers # sudo permissions configuration ├── systemd/ # systemd configuration overrides └── environment # Global environment variables

/var — 変数データ

実行時に変更されるデータを保存します。

/var/ ├── cache/apt/archives/ # APT download cache ├── lib/ # Program runtime data │ ├── dpkg/ # dpkg package database │ └── snapd/ # Snap data ├── log/ # System logs │ ├── syslog # System log │ ├── auth.log # Authentication log │ └── kern.log # Kernel log ├── mail/ # Mail ├── spool/cron/ # Cron jobs └── www/html/ # Default web directory

/home — ユーザーのホーム ディレクトリ

各通常ユーザーには /home/username ディレクトリがあります。

/home/user/ ├── .bashrc # Bash configuration ├── .config/ # User-level application configuration (XDG) ├── .local/ # User-level data and programs │ ├── bin/ # User-level executables │ └── share/ # User-level data ├── .ssh/ # SSH keys and configuration ├── Desktop/ # Desktop ├── Documents/ # Documents ├── Downloads/ # Downloads └── snap/ # Snap user data

/usr — ユーザーレベルのプログラム

システムによってインストールされるプログラムとライブラリ ファイル。読み取り専用のディレクトリ。

/usr/ ├── bin/ # User commands (ls, cp, vim, etc.) ├── sbin/ # System administration commands ├── lib/ # Library files ├── lib64/ # 64-bit library files ├── include/ # C/C++ header files ├── share/ # Architecture-independent data │ ├── applications/ # .desktop files │ ├── doc/ # Documentation │ ├── fonts/ # Fonts │ └── man/ # Man pages └── local/ # Locally compiled programs ├── bin/ ├── lib/ └── share/

/opt — サードパーティ ソフトウェア

サードパーティの商用または大規模なソフトウェア パッケージを個別にインストールしました。

/opt/ ├── google/chrome/ # Google Chrome ├── visual-studio-code/ # VS Code (when not installed as Snap) └── ...

/tmp — 一時ファイル

すべてのユーザーが読み取りと書き込みが可能です。通常はシステムの再起動時にクリアされます。

# Check /tmp usage du -sh /tmp # Permissions: drwxrwxrwt (sticky bit) # Anyone can write, but only the owner can delete their own files

/boot — ブート ファイル

/boot/ ├── vmlinuz-* # Linux kernel ├── initrd.img-* # Initial RAM disk ├── config-* # Kernel configuration ├── grub/ # GRUB bootloader │ └── grub.cfg # GRUB configuration (auto-generated) └── efi/ # EFI partition mount point └── EFI/ ├── ubuntu/ # Ubuntu boot files └── BOOT/ # Default boot files

/dev — デバイス ファイル

/dev/ ├── sda, sdb... # SATA/SCSI hard drives ├── nvme0n1 # NVMe hard drive ├── tty* # Terminal devices ├── video0 # Webcam ├── null # Null device (discards output) ├── zero # Zero device (produces zero bytes) ├── random, urandom # Random number generators └── loop* # Loop devices (used by Snap)

/proc および /sys — 仮想ファイルシステム

これらは実際のディスク ファイルではなく、カーネルによって公開されるインターフェイスです。

# Common /proc files cat /proc/cpuinfo # CPU information cat /proc/meminfo # Memory information cat /proc/version # Kernel version cat /proc/partitions # Partition information # Common /sys files cat /sys/class/power_supply/BAT0/capacity # Battery level cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor # CPU frequency governor

/run — 実行時データ

システム起動後に生成される一時的なランタイム データ。再起動するとクリアされます。

/run/ ├── user/1000/ # Current user runtime data ├── snapd/ # Snap runtime ├── lock/ # Lock files └── systemd/ # systemd runtime

クイックルックアップ

# Find the path of a command which command-name type command-name # Find which package owns a file dpkg -S /path/to/file # List files installed by a package dpkg -L package-name