Difference between revisions of "Directory Structure"
(→Usefull Tools) |
|||
(21 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
==Directory Structure== | ==Directory Structure== | ||
− | At the first step we have to copy the Directory Structure from [https://www.freebsd.org/doc/handbook/dirstructure.html FreeBSD Handbook chapter: 3.5. Directory Structure] in the following table. | + | At the first step we have to copy the Directory Structure from [https://www.freebsd.org/doc/handbook/dirstructure.html FreeBSD Handbook chapter: 3.5. Directory Structure] in the following table. |
+ | We use [https://www.freebsd.org/cgi/man.cgi?query=hier&sektion=7&manpath=freebsd-release-ports hier(7)] and compare this structure with the installed structure of GhostBSD on metal. This [https://www.freebsd.org/cgi/man.cgi?query=hier&sektion=7&manpath=freebsd-release-ports manual page] documents the default FreeBSD file system layout, but the actual hierarchy on a given system is defined at the system administrator's discretion. A well-maintained installation will include a customized version of this document. | ||
+ | |||
{|class="wikitable" style="width:96.5%;background:#FFFFFF; border:2px solid #008000;text-align:left;padding: 10px" | {|class="wikitable" style="width:96.5%;background:#FFFFFF; border:2px solid #008000;text-align:left;padding: 10px" | ||
Line 23: | Line 25: | ||
|Root directory of the file system. | |Root directory of the file system. | ||
|- | |- | ||
− | |/bin/ | + | |[[/bin/]] |
− | |User utilities fundamental to both single-user and multi-user environments. | + | |User utilities fundamental to both single-user and multi-user environments. Examples: cat; chflags; chmod; cp; csh; dd...... |
|- | |- | ||
− | |/boot/ | + | |[[/boot/]] |
|Programs and configuration files used during operating system bootstrap. | |Programs and configuration files used during operating system bootstrap. | ||
|- | |- | ||
− | |/ | + | |/cdrom/ |
− | | | + | |default mount point for CD-ROM drives |
+ | |- | ||
+ | |/compat/ | ||
+ | |normally a link to <code>/usr/compat</code>. If not, then the <code>/usr/compat</code> comments apply | ||
|- | |- | ||
|/dev/ | |/dev/ | ||
− | |Device nodes. Refer to intro(4) for details. | + | |Device nodes. Refer to [https://www.freebsd.org/cgi/man.cgi?query=intro&sektion=4&manpath=freebsd-release-ports intro(4)] for details. Device special files managed by [https://www.freebsd.org/cgi/man.cgi?query=devfs&sektion=5&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports devfs(5)] |
|- | |- | ||
− | |/etc/ | + | |[[/etc/]] |
|System configuration files and scripts. | |System configuration files and scripts. | ||
|- | |- | ||
− | |/ | + | |/home/ |
− | | | + | |is a link to <code>/usr/home</code> |
|- | |- | ||
− | |/ | + | |/include/ |
− | | | + | |new on GhostBSD without content |
|- | |- | ||
− | |/ | + | |/lib/ |
− | | | + | |critical system libraries needed for binaries in <code>/bin</code> and <code>/sbin</code> |
|- | |- | ||
− | |/ | + | |/libdate/ |
− | | | + | |new on GhostBSD without content |
+ | |- | ||
+ | |/libexec/ | ||
+ | |critical system utilities needed for binaries in /bin and <code>/sbin</code> | ||
+ | |- | ||
+ | |/man/ | ||
+ | |new on GhostBSD without content | ||
+ | |- | ||
+ | |/media/ | ||
+ | |contains subdirectories to be used as mount points for removable media such as CDs, USB drives, and floppy disks | ||
|- | |- | ||
|/mnt/ | |/mnt/ | ||
|Empty directory commonly used by system administrators as a temporary mount point. | |Empty directory commonly used by system administrators as a temporary mount point. | ||
+ | |- | ||
+ | |/net/ | ||
+ | |automounted NFS shares; see [https://www.freebsd.org/cgi/man.cgi?query=auto_master&sektion=5&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports auto_master(5)] | ||
+ | |||
|- | |- | ||
|/proc/ | |/proc/ | ||
− | |Process file system. Refer to procfs(5), mount_procfs(8) for details. | + | |Process file system. Refer to [https://www.freebsd.org/cgi/man.cgi?query=procfs&sektion=5&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports procfs(5)], [https://www.freebsd.org/cgi/man.cgi?query=mount_procfs&sektion=8&manpath=freebsd-release-ports mount_procfs(8)] for details. |
|- | |- | ||
|/rescue/ | |/rescue/ | ||
− | |Statically linked programs for emergency recovery as described in rescue(8). | + | |Statically linked programs for emergency recovery as described in [https://www.freebsd.org/cgi/man.cgi?query=rescue&sektion=8&manpath=freebsd-release-ports rescue(8)]. |
|- | |- | ||
|/root/ | |/root/ | ||
|Home directory for the root account. | |Home directory for the root account. | ||
|- | |- | ||
− | |/sbin/ | + | |[[/sbin/]] |
|System programs and administration utilities fundamental to both single-user and multi-user environments. | |System programs and administration utilities fundamental to both single-user and multi-user environments. | ||
+ | |- | ||
+ | |/share/ | ||
+ | |new on GhostBSD without content | ||
+ | |- | ||
+ | |/tests/ | ||
+ | |new on GhostBSD without content | ||
|- | |- | ||
|/tmp/ | |/tmp/ | ||
− | |Temporary files which are usually not preserved across a system reboot. A memory-based file system is often mounted at /tmp. This can be automated using the tmpmfs-related variables of rc.conf(5) or with an entry in /etc/fstab; refer to mdmfs(8) for details. | + | |Temporary files which are usually not preserved across a system reboot. A memory-based file system is often mounted at <code>/tmp</code>. This can be automated using the tmpmfs-related variables of [https://www.freebsd.org/cgi/man.cgi?query=rc.conf&sektion=5&manpath=freebsd-release-ports rc.conf(5)] or with an entry in <code>/etc/fstab</code>; refer to [https://www.freebsd.org/cgi/man.cgi?query=mdmfs&sektion=8&manpath=freebsd-release-ports mdmfs(8)] for details. |
|- | |- | ||
− | |/usr/ | + | |[[/usr/]] |
|The majority of user utilities and applications. | |The majority of user utilities and applications. | ||
|- | |- | ||
− | |/ | + | |[[/var/]] |
− | | | + | |Multi-purpose log, temporary, transient, and spool files. A memory-based file system is sometimes mounted at <code>/var</code>. This can be automated using the varmfs-related variables in [https://www.freebsd.org/cgi/man.cgi?query=rc.conf&sektion=5&manpath=freebsd-release-ports rc.conf(5)] or with an entry in <code>/etc/fstab</code>; refer to [https://www.freebsd.org/cgi/man.cgi?query=mdmfs&sektion=8&manpath=freebsd-release-ports mdmfs(8)] for details. |
|- | |- | ||
− | |/ | + | |/www/ |
− | | | + | |new on GhostBSD without content |
|- | |- | ||
− | |/ | + | |file: /COPYRIGHT |
− | | | + | |opyright (c) 1992-2019 The FreeBSD Project. |
+ | |||
+ | |} | ||
+ | |||
+ | ==Usefull Tools== | ||
+ | This tools are recommended on [https://www.freebsd.org/cgi/man.cgi?query=hier&sektion=7&manpath=freebsd-release-ports hier] man page, the sketch of the file system hierarchy. | ||
+ | |||
+ | |||
+ | {|class="wikitable" style="width:96.5%;background:#FFFFFF; border:2px solid #008000;text-align:left;padding: 10px" | ||
|- | |- | ||
− | | | + | ! scope="col" style="width: 100px;"|'''Command''' |
− | | | + | ! scope="col" style="width: 350px;"|'''Description''' |
|- | |- | ||
− | |/ | + | |apropos(1)||The [https://www.freebsd.org/cgi/man.cgi?query=apropos&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports apropos and whatis] utilities query manual page databases generated by [https://www.freebsd.org/cgi/man.cgi?query=makewhatis&sektion=8&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports makewhatis(8)], evaluating expression for each file in each database. By default, they display the names, section numbers, and description lines of all matching manuals. |
− | + | ||
|- | |- | ||
− | |/ | + | |find(1)||The [https://www.freebsd.org/cgi/man.cgi?query=find&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports find] utility recursively descends the directory tree for each path listed, evaluating an expression (composed of the "primaries" and "operands" listed below) in terms of each file in the tree. |
− | + | ||
|- | |- | ||
− | |/ | + | |finger(1)||The [https://www.freebsd.org/cgi/man.cgi?query=finger&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports finger] utility displays information about the system users. |
− | + | ||
|- | |- | ||
− | |/ | + | |grep(1)||[https://www.freebsd.org/cgi/man.cgi?query=grep&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports grep] searches the named input FILEs (or standard input if no files are named, or the file name - is given) for lines containing a match to the given PATTERN. By default, grep prints the matching lines. |
− | + | ||
|- | |- | ||
− | |/ | + | |ls(1)||[https://www.freebsd.org/cgi/man.cgi?query=ls&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports ls] -- list directory contents; For each operand that names a file of a type other than directory, ls displays its name as well as any requested, associated information. For each operand that names a file of type directory, ls displays the names of files contained within that directory, as well as any requested, associated information. |
− | + | ||
|- | |- | ||
− | |/ | + | |whatis(1)||The [https://www.freebsd.org/cgi/man.cgi?query=whatis&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports apropos and whatis] utilities query manual page databases generated by [https://www.freebsd.org/cgi/man.cgi?query=makewhatis&sektion=8&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports makewhatis(8)], evaluating expression for each file in each database. By default, they display the names, section numbers, and description lines of all matching manuals. |
− | + | ||
|- | |- | ||
− | |/ | + | |whereis(1)||The [https://www.freebsd.org/cgi/man.cgi?query=whereis&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports whereis] utility checks the standard binary, manual page, and source directories for the specified programs, printing out the paths of any it finds. The supplied program names are first stripped of leading path name components, any single trailing extension added by [https://www.freebsd.org/cgi/man.cgi?query=gzip&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports gzip(1)], [https://www.freebsd.org/cgi/man.cgi?query=compress&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports compress(1)], or [https://www.freebsd.org/cgi/man.cgi?query=bzip2&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports bzip2(1)], and the leading `s.' or trailing `,v' from a source code control system. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | |/ | + | |which(1)||The [https://www.freebsd.org/cgi/man.cgi?query=which&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports which] utility takes a list of command names and searches the path for each executable file that would be run had these commands actually been invoked. |
− | + | ||
|- | |- | ||
− | |/ | + | |fd(4)||[https://www.freebsd.org/cgi/man.cgi?query=fd&sektion=4&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports file descriptor] files; The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. |
− | + | ||
|- | |- | ||
− | |/ | + | |devfs(5)||The [https://www.freebsd.org/cgi/man.cgi?query=devfs&sektion=5&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports device] file system, or devfs, provides access to kernel's device namespace in the global file system namespace. The conventional mount point is /dev. |
− | + | ||
|- | |- | ||
− | |/ | + | |fsck(8)||The [https://www.freebsd.org/cgi/man.cgi?query=fsck&sektion=8&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports fsck] utility invokes file system-specific programs to check the spe cial devices listed in the fstab(5) file or in the command line for consistency. |
− | + | ||
|} | |} | ||
− | [[Category:Sysutils]] | + | [[Category:Central Station Sysutils]] |
Latest revision as of 04:59, 3 April 2020
Welcome to Directory Structure. |
Introduction[edit]
The Ghost/FreeBSD directory hierarchy is fundamental to obtaining an overall understanding of the system. The most important directory is root or, “/”. This directory is the first one mounted at boot time and it contains the base system necessary to prepare the operating system for multi-user operation. The root directory also contains mount points for other file systems that are mounted during the transition to multi-user operation.
Source: FreeBSD Handbook Chapter: 3.5. Directory Structure
A mount point is a directory where additional file systems can be connected to a parent file system. This is further described in FreeBSD Handbook Section 3.6, “Disk Organization”.
See also Standard Mount Points.
Directory Structure[edit]
At the first step we have to copy the Directory Structure from FreeBSD Handbook chapter: 3.5. Directory Structure in the following table. We use hier(7) and compare this structure with the installed structure of GhostBSD on metal. This manual page documents the default FreeBSD file system layout, but the actual hierarchy on a given system is defined at the system administrator's discretion. A well-maintained installation will include a customized version of this document.
Directory | Description |
---|---|
/ | Root directory of the file system. |
/bin/ | User utilities fundamental to both single-user and multi-user environments. Examples: cat; chflags; chmod; cp; csh; dd...... |
/boot/ | Programs and configuration files used during operating system bootstrap. |
/cdrom/ | default mount point for CD-ROM drives |
/compat/ | normally a link to /usr/compat . If not, then the /usr/compat comments apply
|
/dev/ | Device nodes. Refer to intro(4) for details. Device special files managed by devfs(5) |
/etc/ | System configuration files and scripts. |
/home/ | is a link to /usr/home
|
/include/ | new on GhostBSD without content |
/lib/ | critical system libraries needed for binaries in /bin and /sbin
|
/libdate/ | new on GhostBSD without content |
/libexec/ | critical system utilities needed for binaries in /bin and /sbin
|
/man/ | new on GhostBSD without content |
/media/ | contains subdirectories to be used as mount points for removable media such as CDs, USB drives, and floppy disks |
/mnt/ | Empty directory commonly used by system administrators as a temporary mount point. |
/net/ | automounted NFS shares; see auto_master(5) |
/proc/ | Process file system. Refer to procfs(5), mount_procfs(8) for details. |
/rescue/ | Statically linked programs for emergency recovery as described in rescue(8). |
/root/ | Home directory for the root account. |
/sbin/ | System programs and administration utilities fundamental to both single-user and multi-user environments. |
/share/ | new on GhostBSD without content |
/tests/ | new on GhostBSD without content |
/tmp/ | Temporary files which are usually not preserved across a system reboot. A memory-based file system is often mounted at /tmp . This can be automated using the tmpmfs-related variables of rc.conf(5) or with an entry in /etc/fstab ; refer to mdmfs(8) for details.
|
/usr/ | The majority of user utilities and applications. |
/var/ | Multi-purpose log, temporary, transient, and spool files. A memory-based file system is sometimes mounted at /var . This can be automated using the varmfs-related variables in rc.conf(5) or with an entry in /etc/fstab ; refer to mdmfs(8) for details.
|
/www/ | new on GhostBSD without content |
file: /COPYRIGHT | opyright (c) 1992-2019 The FreeBSD Project. |
Usefull Tools[edit]
This tools are recommended on hier man page, the sketch of the file system hierarchy.
Command | Description |
---|---|
apropos(1) | The apropos and whatis utilities query manual page databases generated by makewhatis(8), evaluating expression for each file in each database. By default, they display the names, section numbers, and description lines of all matching manuals. |
find(1) | The find utility recursively descends the directory tree for each path listed, evaluating an expression (composed of the "primaries" and "operands" listed below) in terms of each file in the tree. |
finger(1) | The finger utility displays information about the system users. |
grep(1) | grep searches the named input FILEs (or standard input if no files are named, or the file name - is given) for lines containing a match to the given PATTERN. By default, grep prints the matching lines. |
ls(1) | ls -- list directory contents; For each operand that names a file of a type other than directory, ls displays its name as well as any requested, associated information. For each operand that names a file of type directory, ls displays the names of files contained within that directory, as well as any requested, associated information. |
whatis(1) | The apropos and whatis utilities query manual page databases generated by makewhatis(8), evaluating expression for each file in each database. By default, they display the names, section numbers, and description lines of all matching manuals. |
whereis(1) | The whereis utility checks the standard binary, manual page, and source directories for the specified programs, printing out the paths of any it finds. The supplied program names are first stripped of leading path name components, any single trailing extension added by gzip(1), compress(1), or bzip2(1), and the leading `s.' or trailing `,v' from a source code control system. |
which(1) | The which utility takes a list of command names and searches the path for each executable file that would be run had these commands actually been invoked. |
fd(4) | file descriptor files; The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. |
devfs(5) | The device file system, or devfs, provides access to kernel's device namespace in the global file system namespace. The conventional mount point is /dev. |
fsck(8) | The fsck utility invokes file system-specific programs to check the spe cial devices listed in the fstab(5) file or in the command line for consistency. |