Skip to Content

Layout do diretório

Visão geral da estrutura de diretórios

/ ├── 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

Descrições detalhadas

/etc — Arquivos de configuração do sistema

Armazena arquivos de configuração para quase todos os serviços do sistema.

/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 — Dados variáveis

Armazena dados que mudam durante o tempo de execução.

/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 — Diretórios iniciais do usuário

Cada usuário regular possui um diretório /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 — Programas em nível de usuário

Programas e arquivos de biblioteca instalados pelo sistema. Diretório somente leitura.

/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 — Software de terceiros

Pacotes de software grandes ou comerciais de terceiros instalados de forma independente.

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

/tmp — Arquivos temporários

Legível e gravável por todos os usuários. Geralmente apagado na reinicialização do sistema.

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

/boot — Arquivos de inicialização

/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 — Arquivos de dispositivos

/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 e /sys — Sistemas de arquivos virtuais

Estes não são arquivos de disco reais, mas interfaces expostas pelo kernel.

# 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 — Dados de tempo de execução

Dados temporários de tempo de execução gerados após a inicialização do sistema; apagado na reinicialização.

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

Pesquisa rápida

# 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