何をすべきで/opt/あり、何をすべきであり、何をすべきである/usr/か?私の理解では、これ/usr/はユーザーのホームディレクトリ用でしたが、それらが存在するので、/Users/現在の目的は何ですか?
すべての組み込みディレクトリの使用目的に関するマニュアルまたはガイドはありますか?とは何ですか/home/、または/net/?
何をすべきで/opt/あり、何をすべきであり、何をすべきである/usr/か?私の理解では、これ/usr/はユーザーのホームディレクトリ用でしたが、それらが存在するので、/Users/現在の目的は何ですか?
すべての組み込みディレクトリの使用目的に関するマニュアルまたはガイドはありますか?とは何ですか/home/、または/net/?
回答:
すべての組み込みディレクトリの使用目的に関するマニュアルまたはガイドはありますか?/ home /、または/ net /とは何ですか?
見てくださいプログラミングガイドファイルシステムの最新情報については、とのman hierファイルシステム階層の「歴史的なスケッチを」(それは参考のためにこの回答の末尾に含まれています)を提供し、ターミナル内を、。
あなたの質問へのコメントは、Filesystem Hierarchy Standardに言及しています。File System Programming Guideを熟読した後man hier、macOSはFHSに準拠していないという結論にたどり着くでしょう。これはLinuxのことです。もちろん、UNIXの起源が共通しているため、macOSのFHSとファイルシステムレイアウトには類似点がありますが、違いは顕著です。macOSはこれらのいずれも使用しません。
/bootフォルダー-> macOSは/System/Library/Kernels代わりに使用します(macOSの古いバージョンでは、カーネルを含むフォルダーはでした/)/homeフォルダー-> macOSは/Users代わりに使用します/rootフォルダー-> macOSは/var/root代わりに使用しますまた/opt、どのドキュメントでも一度も言及されていません(/opt以下で詳しく説明します)。
MacOSの及びFHS準拠OS間のさらなるdistictionでの使用であり/private、例えば、/etcあるシンボリックリンクへ/private/etc。
概要/net:これはオートマウンターマップ(リストされている/etc/auto_master)です。詳細については、Wikipediaを参照してください。
/ opt /に何を入れて何をすべきか、/ usr /に何を入れるべきか?私の理解では、/ usr /はユーザーのホームディレクトリ用でしたが、/ Users /に存在するので、今の目的は何ですか?
が、/usr ユーザーのホームディレクトリを配置するために、過去に使用された、それはもはやケースません。
最近で/usrは、ユーザーコマンド(/usr/bin通常のユーザーや/usr/sbin管理ユーザーなどroot)、共有ライブラリ(/usr/lib)、マニュアルページ(/usr/share/man)、ユーザーが直接実行してはならない実行可能ファイル(/usr/libexec)などが含まれています。
また/usr/local、ベースOSに付属していないプログラム、ライブラリ、その他のファイルを配置するためのサブディレクトリを提供します。
/optに非常によく似た役割を/usr/local持ち、互換性があるようです。しかし、他のLinux / UNIXのシステム管理者と協力し、私の経験から、があるように思わ好みのための/usr/localBSDベースのUNIX OSのインチ
だからこれは私の考えです: macOSはBSDベースであり、したがって私はを使用します/usr/local。/usr/local/binたとえば、プログラムディレクトリを作成してから、などへのシンボリックリンクコマンドを作成できることに注意してください。
/usr/local/mysql
/usr/local/mysql/bin/mysqladmin
/usr/local/mysql/lib/libmysqlclient.so
/usr/local/bin/mysqladmin -> ../mysql/bin/mysqladmin
/usr/local/lib/libmysqlclient.so -> ../mysql/lib/libmysqlclient.so
これはLinuxおよびUNIXでも一般的な慣習でしたが、FHSでは明示的に禁止しています。サードパーティのパッケージを独自のディレクトリ階層にインストールする場合は、/opt/<package>代わりに使用する必要があります。FHS準拠では、構成ファイルをに/etc/opt/<package>、変数ファイルをに配置する必要があることに注意してください/var/opt/<package>。
したがって、macOSでは、/usr/local上記のように固執することをお勧めします。
にインストールするCisco VPNやXQuartzのようなアドオンソフトウェアを知っている/optので、上記の区別が曖昧になり始めます。
man hier
前述のとおり、これはman hier次のとおりです。
 A historical sketch of the filesystem hierarchy.  The modern macOS filesystem is documented in the
 ``File System Programming Guide'' available on Apple Developer.
 /             root directory of the filesystem
 /bin/         user utilities fundamental to both single-user and multi-user environments
 /dev/         block and character device files
               fd/  file descriptor files; see fd(4)
 /etc/         system configuration files and scripts
 /mach_kernel  kernel executable (the operating system loaded into memory at boot time).
 /sbin/        system programs and administration utilities fundamental to both single-user and multi-
               user environments
 /tmp/         temporary files
 /usr/         contains the majority of user utilities and applications
               bin/      common utilities, programming tools, and applications
               include/  standard C include files
                         arpa/       C include files for Internet service protocols
                         hfs/        C include files for HFS
                         machine/    machine specific C include files
                         net/        misc network C include files
                         netinet/    C include files for Internet standard protocols; see inet(4)
                         nfs/        C include files for NFS (Network File System)
                         objc/       C include files for Objective-C
                         protocols/  C include files for Berkeley service protocols
                         sys/        system C include files (kernel data structures)
                         ufs/        C include files for UFS
               lib/      archive libraries
               libexec/  system daemons & system utilities (executed by other programs)
               local/    executables, libraries, etc. not included by the basic operating system
               sbin/     system daemons & system utilities (executed by users)
               share/    architecture-independent data files
                         calendar/  a variety of pre-fab calendar files; see calendar(1)
                         dict/      word lists; see look(1)
                                    web2        words from Webster's 2nd International
                                    words       common words
                         man/       manual pages
                         misc/      misc system-wide ascii text files
                         mk/        templates for make; see make(1)
                         skel/      example . (dot) files for new accounts
                         tabset/    tab description files for a variety of terminals; used in the term-
                                    cap file; see termcap(5)
                         zoneinfo/  timezone configuration information; see tzfile(5)
 /var/         multi-purpose log, temporary, transient, and spool files
               at/        timed command scheduling files; see at(1)
               backups/   misc. backup files
               db/        misc. automatically generated system-specific database files
               log/       misc. system log files
               mail/      user mailbox files
               run/       system information files describing various info about system since it was
                          booted
                          utmpx       database of current users; see utmpx(5)
               rwho/      rwho data files; see rwhod(8), rwho(1), and ruptime(1)
               spool/     misc. printer and mail system spooling directories
                          mqueue/     undelivered mail queue; see sendmail(8)
               tmp/       temporary files that are kept between system reboots
               folders/   per-user temporary files and caches
/usr/X11/推奨されていませんか?
                    man hier):AppleのMacのOS Xのhierのマニュアルページ(7)
                    /opt(MacPortsに関連する/opt/localことが多い)およびパスの「標準的な」使用法を読んだとき、少なくとも2001年以来存在していたFinkについても考えます。Finkは、次のパスの使用を一般化しました。
/sw
Virex 7.2、すべての.Macメンバーに無料、悪名高いFinkライブラリの上書き:
これは非常に悪いです。Finkユーザー、これをインストールしないでください…
/Volumes/Virex 7.2.dmg/Virex 7.2.pkg 328 % lsbom Contents/Resources/Virex\ 7.2.bom | grep sw
./sw    40775   0/80
./sw/lib        40775   0/80
./sw/lib/libcrypto.0.9.6.dylib  100644  0/80    945416  3192711062
./sw/lib/libcurl.2.0.2.dylib    100644  0/80    634480  510417796
./sw/lib/libcurl.2.dylib        100644  0/80    634480  510417796
./sw/lib/libdl.0.dylib  100644  0/80    15124   4193639260
./sw/lib/libssl.0.9.6.dylib     100644  0/80    261776  3001832603
ライセンスの尊重など、インシデントに関する他の議論には以下が含まれます。
A フィンクニュース項目:
Virexの問題は解決しました
McAfeeはVirex 7.2.1をリリースしました。これにより、メインのFinkディレクトリが上書きされなくなりました
/sw。Finkユーザーは、引き続きVirex 7.2を避けてください。初期の報告では、Virexを7.2から7.2.1にアップグレードしても問題が残ることが示されています。Finkがインストールされていない状態でVirexをアップグレードし、その後Finkをインストールする場合は、インストールする
/sw前に手動でディレクトリを削除する必要があります。また、Finkが既にインストールされているVirexをアップグレードする場合は、すぐにfink再インストールopenssl-shlibs dlcompat-shlibs curl-ssl-shlibsを実行して、Virexアップグレードで削除された可能性のあるファイルを復元する必要があります。
McAfee Virexバージョン7.2.1のリリースノートでは、Finkのユーザーに引き起こされる問題については言及していません。
補足として…
Virex 7.5が.Macメンバーに利用できなくなったという観察。
これは、FreeBSDやPC-BSDなどのオペレーティングシステムにも当てはまります。
ながら/usr/home/で明示的ではありませんhttps://www.freebsd.org/cgi/man.cgi?query=hier&sektion=7&manpath=FreeBSD+10.2-RELEASEパスは、次のような文書に例示されています。