特殊:Badtitle/NS100:LinuxFilesystemTreeOverview:修订间差异
小 新页面: {{From|https://help.ubuntu.com/community/LinuxFilesystemTreeOverview}} {{Languages|UbuntuHelp:LinuxFilesystemTreeOverview}} "Linux systems organized files in a hierarchical filesystem tre... |
小无编辑摘要 |
||
(未显示同一用户的5个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/LinuxFilesystemTreeOverview}} | {{From|https://help.ubuntu.com/community/LinuxFilesystemTreeOverview}} | ||
{{Languages|UbuntuHelp:LinuxFilesystemTreeOverview}} | {{Languages|UbuntuHelp:LinuxFilesystemTreeOverview}} | ||
Ubuntu (like all UNIX-like systems) organizes files in a hierarchical tree, where relationships are thought of in teams of children and parent. ''Directories'' can contain other directories as well as ''regular files'', which are the "leaves" of the tree. | |||
Any element of the tree can be references by a ''path name''; an ''absolute path name'' starts with the character <code><nowiki>/</nowiki></code> (identifying the ''root directory'', which contains all other directories and files), then every child directory that must be traversed to reach the element is listed, each separated by a <code><nowiki>/</nowiki></code> sign. | |||
=== | A ''relative path name'' is one that doesn't start with <code><nowiki>/</nowiki></code>; in that case, the directory tree is traversed starting from a given point, which changes depending on context, called the ''current directory''. In every directory, there are two special directories called <code><nowiki>.</nowiki></code> and <code><nowiki>..</nowiki></code>, which refer respectively to the directory itself, and to its parent directory. | ||
The fact that all files and directories have a common root means that, even if several different storage devices are present on the system, they are all seen as directories somewhere in the tree, once they are [[UbuntuHelp:Mount|mounted]] to the desired place. | |||
[[UbuntuHelp:FilePermissions|FilePermissions]] are another important part of the files organization system: they are superimposed to the directory structure and assign ''permissions'' to each element of the tree, ultimately decided by whom it can be accessed and how. | |||
=== Examples === | |||
An absolute path name, pointing to what is normally an executable file on an Ubuntu system: | |||
<pre><nowiki> | <pre><nowiki> | ||
/usr/bin/test | |||
</nowiki></pre> | </nowiki></pre> | ||
An absolute path name, but pointing to a directory instead of a regular file: | |||
=== | <pre><nowiki> | ||
/usr/bin/ | |||
</nowiki></pre> | |||
A relative path name, which will point to <code><nowiki>/usr/bin/test</nowiki></code> only if the current directory is <code><nowiki>/usr/</nowiki></code>: | |||
<pre><nowiki> | |||
bin/test | |||
</nowiki></pre> | |||
A relative path name, which will point to <code><nowiki>/usr/bin/test</nowiki></code> if the current directory is any directory in <code><nowiki>/usr/</nowiki></code>, for instance <code><nowiki>/usr/share/</nowiki></code>: | |||
<pre><nowiki> | |||
../bin/test | |||
</nowiki></pre> | |||
A path name using the special shortcut <code><nowiki>~</nowiki></code>, which refers to the current user's ''home'' directory: | |||
<pre><nowiki> | |||
~/Desktop/ | |||
</nowiki></pre> | |||
Path names can contain almost any character, but some characters, such as '''space''', must be ''escaped'' in most software, usually by enclosing the name in quotation marks: | |||
<pre><nowiki> | |||
"~/Examples/Experience ubuntu.ogg" | |||
</nowiki></pre> | |||
or by employing the escape character <code><nowiki>\</nowiki></code>: | |||
<pre><nowiki> | |||
~/Examples/Experience\ ubuntu.ogg | |||
</nowiki></pre> | |||
=== Main directories === | |||
The standard Ubuntu directory structure mostly follows the [http://www.pathname.com/fhs Filesystem Hierarchy Standard], which can be referred to for more detailed information. | |||
Here, only the most important directories in the system will be presented. | |||
'''/bin''' | '''/bin''' | ||
is a place for most commonly used [[UbuntuHelp:UsingTheTerminal|terminal]] commands, like <code><nowiki>ls</nowiki></code>, <code><nowiki>mount</nowiki></code>, <code><nowiki>rm</nowiki></code>, etc. | |||
'''/boot''' | '''/boot''' | ||
contains files needed to start up the system, including the [[UbuntuHelp:Kernel|Linux kernel]], a RAM disk image and [[UbuntuHelp:GrubHowTo|bootloader]] configuration files. | |||
'''/dev''' | '''/dev''' | ||
contains all ''device files'', which are not regular files but instead refer to various hardware devices on the system, including hard drives. | |||
'''/etc''' | '''/etc''' | ||
contains system-global configuration files, which affect the system's behavior for all users. | |||
'''/home''' | '''/home''' | ||
home sweet home, this is the place for users' home directories. | |||
'''/lib''' | '''/lib''' | ||
contains very important dynamic libraries and kernel modules | |||
'''/media''' | '''/media''' | ||
is intended as a mount point for external devices, such as hard drives or removable media (floppies, CDs, DVDs). | |||
'''/mnt''' | '''/mnt''' | ||
is also a place for mount points, but dedicated specifically to "temporarily mounted" devices, such as network filesystems. | |||
'''/opt''' | '''/opt''' | ||
can be used to store addition software for your system, which is not handled by the [[UbuntuHelp:InstallingSoftware|package manager]]. | |||
'''/proc''' | '''/proc''' | ||
is a virtual filesystem that provides a mechanism for kernel to send information to processes. | |||
'''/root''' | '''/root''' | ||
is the [[UbuntuHelp:RootSudo|superuser]]'s home directory, not in <code><nowiki>/home/</nowiki></code> to allow for booting the system even if <code><nowiki>/home/</nowiki></code> is not available. | |||
'''/sbin''' | '''/sbin''' | ||
contains important administrative commands that should generally only be employed by the [[UbuntuHelp:RootSudo|superuser]]. | |||
'''/srv''' | '''/srv''' | ||
can contain data directories of services such as HTTP (<code><nowiki>/srv/www/</nowiki></code>) or FTP. | |||
'''/sys''' | '''/sys''' | ||
is a virtual filesystem that can be accessed to set or obtain information about the kernel's view of the system. | |||
'''/tmp''' | '''/tmp''' | ||
is a place for temporary files used by applications. | |||
'''/usr''' | '''/usr''' | ||
contains the majority of user utilities and applications, and partly replicates the root directory structure, containing for instance, among others, <code><nowiki>/usr/bin/</nowiki></code> and <code><nowiki>/usr/lib</nowiki></code>. | |||
'''/var''' | '''/var''' | ||
is dedicated variable data that potentially changes rapidly; a notable directory it contains is <code><nowiki>/var/log</nowiki></code> where system log files are kept. | |||
---- | ---- | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年5月12日 (二) 17:43的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/LinuxFilesystemTreeOverview }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/af | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Afrikaans| [[::LinuxFilesystemTreeOverview/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/ar | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|العربية| [[::LinuxFilesystemTreeOverview/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/az | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|azərbaycanca| [[::LinuxFilesystemTreeOverview/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/bcc | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|جهلسری بلوچی| [[::LinuxFilesystemTreeOverview/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/bg | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|български| [[::LinuxFilesystemTreeOverview/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/br | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|brezhoneg| [[::LinuxFilesystemTreeOverview/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/ca | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|català| [[::LinuxFilesystemTreeOverview/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/cs | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|čeština| [[::LinuxFilesystemTreeOverview/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/de | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Deutsch| [[::LinuxFilesystemTreeOverview/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/el | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Ελληνικά| [[::LinuxFilesystemTreeOverview/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/es | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|español| [[::LinuxFilesystemTreeOverview/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/fa | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|فارسی| [[::LinuxFilesystemTreeOverview/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/fi | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|suomi| [[::LinuxFilesystemTreeOverview/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/fr | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|français| [[::LinuxFilesystemTreeOverview/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/gu | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|ગુજરાતી| [[::LinuxFilesystemTreeOverview/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/he | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|עברית| [[::LinuxFilesystemTreeOverview/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/hu | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|magyar| [[::LinuxFilesystemTreeOverview/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/id | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Bahasa Indonesia| [[::LinuxFilesystemTreeOverview/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/it | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|italiano| [[::LinuxFilesystemTreeOverview/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/ja | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|日本語| [[::LinuxFilesystemTreeOverview/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/ko | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|한국어| [[::LinuxFilesystemTreeOverview/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/ksh | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Ripoarisch| [[::LinuxFilesystemTreeOverview/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/mr | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|मराठी| [[::LinuxFilesystemTreeOverview/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/ms | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Bahasa Melayu| [[::LinuxFilesystemTreeOverview/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/nl | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Nederlands| [[::LinuxFilesystemTreeOverview/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/no | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|norsk| [[::LinuxFilesystemTreeOverview/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/oc | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|occitan| [[::LinuxFilesystemTreeOverview/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/pl | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|polski| [[::LinuxFilesystemTreeOverview/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/pt | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|português| [[::LinuxFilesystemTreeOverview/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/ro | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|română| [[::LinuxFilesystemTreeOverview/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/ru | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|русский| [[::LinuxFilesystemTreeOverview/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/si | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|සිංහල| [[::LinuxFilesystemTreeOverview/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/sq | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|shqip| [[::LinuxFilesystemTreeOverview/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/sr | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|српски / srpski| [[::LinuxFilesystemTreeOverview/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/sv | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|svenska| [[::LinuxFilesystemTreeOverview/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/th | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|ไทย| [[::LinuxFilesystemTreeOverview/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/tr | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Türkçe| [[::LinuxFilesystemTreeOverview/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/vi | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|Tiếng Việt| [[::LinuxFilesystemTreeOverview/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/yue | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|粵語| [[::LinuxFilesystemTreeOverview/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/zh | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|中文| [[::LinuxFilesystemTreeOverview/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/zh-hans | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|中文(简体)| [[::LinuxFilesystemTreeOverview/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LinuxFilesystemTreeOverview | UbuntuHelp:LinuxFilesystemTreeOverview | {{#if: | :}}LinuxFilesystemTreeOverview}}/zh-hant | • {{#if: UbuntuHelp:LinuxFilesystemTreeOverview|中文(繁體)| [[::LinuxFilesystemTreeOverview/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:LinuxFilesystemTreeOverview|:LinuxFilesystemTreeOverview|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :LinuxFilesystemTreeOverview/zh | | {{#ifexist: LinuxFilesystemTreeOverview/zh | | {{#ifeq: {{#titleparts:LinuxFilesystemTreeOverview|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:LinuxFilesystemTreeOverview|1|-1|}} | zh | | }}
Ubuntu (like all UNIX-like systems) organizes files in a hierarchical tree, where relationships are thought of in teams of children and parent. Directories can contain other directories as well as regular files, which are the "leaves" of the tree.
Any element of the tree can be references by a path name; an absolute path name starts with the character /
(identifying the root directory, which contains all other directories and files), then every child directory that must be traversed to reach the element is listed, each separated by a /
sign.
A relative path name is one that doesn't start with /
; in that case, the directory tree is traversed starting from a given point, which changes depending on context, called the current directory. In every directory, there are two special directories called .
and ..
, which refer respectively to the directory itself, and to its parent directory.
The fact that all files and directories have a common root means that, even if several different storage devices are present on the system, they are all seen as directories somewhere in the tree, once they are mounted to the desired place.
FilePermissions are another important part of the files organization system: they are superimposed to the directory structure and assign permissions to each element of the tree, ultimately decided by whom it can be accessed and how.
Examples
An absolute path name, pointing to what is normally an executable file on an Ubuntu system:
/usr/bin/test
An absolute path name, but pointing to a directory instead of a regular file:
/usr/bin/
A relative path name, which will point to /usr/bin/test
only if the current directory is /usr/
:
bin/test
A relative path name, which will point to /usr/bin/test
if the current directory is any directory in /usr/
, for instance /usr/share/
:
../bin/test
A path name using the special shortcut ~
, which refers to the current user's home directory:
~/Desktop/
Path names can contain almost any character, but some characters, such as space, must be escaped in most software, usually by enclosing the name in quotation marks:
"~/Examples/Experience ubuntu.ogg"
or by employing the escape character \
:
~/Examples/Experience\ ubuntu.ogg
Main directories
The standard Ubuntu directory structure mostly follows the Filesystem Hierarchy Standard, which can be referred to for more detailed information.
Here, only the most important directories in the system will be presented.
/bin
is a place for most commonly used terminal commands, like ls
, mount
, rm
, etc.
/boot
contains files needed to start up the system, including the Linux kernel, a RAM disk image and bootloader configuration files.
/dev
contains all device files, which are not regular files but instead refer to various hardware devices on the system, including hard drives.
/etc
contains system-global configuration files, which affect the system's behavior for all users.
/home
home sweet home, this is the place for users' home directories.
/lib
contains very important dynamic libraries and kernel modules
/media
is intended as a mount point for external devices, such as hard drives or removable media (floppies, CDs, DVDs).
/mnt
is also a place for mount points, but dedicated specifically to "temporarily mounted" devices, such as network filesystems.
/opt
can be used to store addition software for your system, which is not handled by the package manager.
/proc
is a virtual filesystem that provides a mechanism for kernel to send information to processes.
/root
is the superuser's home directory, not in /home/
to allow for booting the system even if /home/
is not available.
/sbin
contains important administrative commands that should generally only be employed by the superuser.
/srv
can contain data directories of services such as HTTP (/srv/www/
) or FTP.
/sys
is a virtual filesystem that can be accessed to set or obtain information about the kernel's view of the system.
/tmp
is a place for temporary files used by applications.
/usr
contains the majority of user utilities and applications, and partly replicates the root directory structure, containing for instance, among others, /usr/bin/
and /usr/lib
.
/var
is dedicated variable data that potentially changes rapidly; a notable directory it contains is /var/log
where system log files are kept.