Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

FHS - File Hierarchy Standard

/ - root dir

/bin - command binaries, base commands for basic system

/boot - often on a separate partition, bootloader (GRUB/LiLo) & kernel stored here

/dev - devices are stored here (virtual, like /dev/sdb)

/etc - config files stored here

/home - user home directories, often stored on separate partition or network storage

/lib - shared library files, that executable files need

/proc - virtual file system, made on boot, where the running system is configured

/root - root user home directory, always local, so you can log in the system, even when /home directory crashes

/sbin - system binaries, libraries for system commands, like "mount"

/tmp - temporary file storage, sticky bit is set here

/usr - often READ-ONLY, on a separate HDD, contains user binaries, like OpenOffice, games etc. (in /usr/bin or /usr/share)

/var - variable files, logs, mail, thins that change often. It is usually a fast drive, separate partition

/media - mount place for removable media in newer OS

/mnt - legacy location for removable media

/opt - optional software stored here (like Atlassian Confluence)

Tools to help find things

Find

Slow, but "accurate" - searches the directories in real-time. Searches only for exact match, not very good at wild-card searches. Can also search for files by access time, files owned by chosen user etc.:

find / -user alex

 

Locate

Example:

locate mail

Fast. Searches not only for direct match file names, but also for anything containing the name in question (folders & files).

 

Locate by default does not search in many locations - specified in /etc/updatedb.conf file.

 

Locate searches using an Update DB, made by using the "find" command and updated once a day. So it does not find newly created files right away, before next update of DB.

 

sudo updatedb # force update of "locate" command DB

 

Which

A command to help find commands:

which ls # finds "ls" command

 

Type

Tells if a command is aliased.

 

Whereis

Shows more info on commands: where they are located, where their man page is located.