设为首页 收藏本站
查看: 1019|回复: 0

[经验分享] Mac 系统隐藏文件功能指南

[复制链接]

尚未签到

发表于 2016-5-18 00:45:38 | 显示全部楼层 |阅读模式
     今天在玩OS的terminal的时候突然想到哪些隐藏的文件夹都有什么用,于是决定搜索一下,看看这些文件夹的功能。

 

Mac OS X Hidden Files Directories 


._whateverThese files are created on volumes that don't natively support full HFS file characteristics (e.g. ufs volumes,Windows fileshares, etc). When a Mac file is copied to such a volume, its data fork is stored under the file's regular name, and the additional HFS information (resource fork, type creator codes, etc) is stored in a second file (in AppleDouble format), with a name that starts with "._". (These files are, of course, invisible as far as OS-X is concerned, but not to other OS's; this can sometimes be annoying...)
.DS_StoreThis file in created by the Finder to keep track of folder view options, icon positions, and other visual information about folders. A separate .DS_Store file is created in each directory to store information about that directory, so you'll find them appearing all over the directory tree, in pretty much every folder you've visited with the OS X Finder.
~/.TrashUsed to store files folders from the boot volume that a particular user has thrown in the trash, but that haven't been erased yet.
/.Spotlight-V100Used to store metadata indexes and indexing rules for Spotlight (version 1.00 apparently). Only created under Mac OS X 10.4.
/Volumes/(whatever)/.TrashesOn volumes other than the boot volume, a .Trashes folder is used to hold files folders that've been put in the trash but not yet deleted. Since each user has their own personal trash can, subfolders are created under .Trashes for different users, named according to their user ID number. For example, if user #501 throws something on a volume named "Data" into the trash, it'd be moved to a directory named /Volumes/Data/.Trashes/501/.
Permissions on this folder are set so that you can only access a trash can if you can guess the users' ID -- that is, you cannot view a list of which users actually have trash cans in existance. If you're trying to free disk space, this can make it rather tricky to find delete the files in other users' trash cans...
/.hiddenThis contains a list of files for the Finder to hide -- it's one of three ways a file can be made invisible in OS X. This file is semi-obsolete -- i.e. it does not exist in a standard installation of Mac OS X 10.4, but the Finder will still respect it if it exists...
/.hotfiles.btreeUsed to track commonly-used small files so their position on disk can be optimized (a process called “adaptive hot file clustering”).
/.volThis pseudo-directory is used to access files by their ID number (aka inode number) rather than by name. For example, /.vol/234881034/105486 is file #105486 on volume #234881034.
/automountUsed to handle "quasi-static" mounts of network volumes under OS X 10.1. Under most unixes, if a network volume is statically mounted on a client, it's mounted somewhere in the file system, so it looks shows up like a normal directory. Under OS X 10.1, a statically-mounted network volume will actually be mounted in /automount, and a symbolic link pointing to it will be placed where the volume would normally be mounted, thus emulating the normal result.
(Compare this with how "network" mounts are handled via/private/Network.)
/binThis is one of several places where unix-style binaries (that is, programs, or command-line commands) are kept. The programs in /bin include the more common and fundamental things that are used from the unix command line (e.g. ls and rm), as well as several shells (the programs that provide the command line itself).
The other places where similar files are stored are /sbin, /usr/bin, /usr/sbin, and possibly /usr/local/bin, /usr/local/sbin, and maybe even ~/bin/powerpc-apple-macos; collectively, these can be thought of as the command line's equivalent of /Applications.
/cores(This is actually stored in /private/cores; /cores is really just a symbolic link.)
Under some conditions, when a program crashes, it'll "dump core" (essentially, store a copy of the program state at the time it crashed) into this directory. This is really only useful for programmers trying to debug their own programs.
/devThis directory contains what're technically known as device special files. These are not really files in the usual sense, they're more like placeholders that the system uses to keep track of the devices (disks, keyboards, monitors, network connections, etc) attached to it.
/etc(This is actually stored in /private/etc; /etc is really just a symbolic link.)
On a typical unix system the /etc folder will contain all the configuration files for a system, including both documents specifying config information as well as scripts for actually performing various configuration tasks. On OS X, some of the config information stored here is overridden by NetInfo or other directory services, but the /etc files still exist.
/lost+foundIf Disk Utility or fsck discover "orphaned" files (i.e. files that exist, but aren't actually in any directory), they'll be placed here.
/NetworkThis is the "real" location of the Network item that appears at the Computer level in the finder. It provides a place to attach network-wide resources and server volumes. Under OS X 10.1, network resources actually tend to get mounted in /private/Network, and symbolic links to them created in /Network.
In OS 10.3, various network resources (mainly servers) appear dynamically in /Network (thanks to some virtual filesystem magic).
/mach
/mach.sym
/mach_kernel
The Mach kernel (which runs at the very core of Mac OS X), along with a couple of shortcuts for getting at it in various ways.
/privateIn OS X certain root level directories are actually symbolic links (similar to aliases) to directories in /private. Examples are /cores, /etc, and /var which are respectively linked to /private/cores, /private/etc, and /private/var. /private also contains a directory of drivers for certain peripherals.
/private/NetworkUsed to handle "network" (non-static) mounts of network volumes under OS X 10.1. Under previous versions, network mounts were mounted in /Network, but in 10.1 they're actually mounted in /private/network, and a symbolic link is placed in /Network pointing to the actual mount point.
(Compare this with how "quasi-static" mounts are handled via /automount.)
/sbinThe /sbin directory is like /bin except it contains binaries that are specifically used for system administration (e.g.mount and fsck).
/tmp(This is actually stored in /private/tmp; /tmp is really just a symbolic link.)
Programs that need temporary space on the hard disk are usally set up to writetemporary files to the /tmp directory (although some use /var/tmp instead).
/usrThe /usr directory contains many subdirectories that have binaries and files specifically of use to the normal (unix) user.
/usr/binAnother place where unix binaries are kept.
/usr/libLibraries available for use by progrmming on Mac OS X. Unless you install the Developer Tools, this'll be mostly empty.
Note that this has no relation to Mac OS X's various "Library" directories."
/usr/libexecHolds various daemon programs, system maintenance scripts, and other unix-style programs that usually aren't run directly by humans.
/usr/localAs in most unixes, this directory is used to store local customizations and additions to the standard OS installation (e.g. /usr/local/bin would be likely to hold unix binaries added by the system administrator). This directory can be thought of roughly as the unix equivalent of Mac OS X's local library. In the standard install of Mac OS X it is (not surprisingly) completely empty.
Note: As of OS X 10.2, these directories are no longer in the default search path for command-line executables; as a result, anything installed here will not be useable without taking extra steps of one sort or another.
/usr/sbinYet another place where unix binaries are kept.
/usr/shareContains various data and text files that can, in principle, be shared by multiple architectures (a distinction which makes a lot more sense under other flavors of unix than it does under Mac OS X).
/usr/standaloneContains boot loader programs for (potentially) various computer architectures. In the installs I've looked at, this is simply a duplicate of theBootX loader (also found in /System/Library/CoreServices/BootX); I'm not sure why both copies are needed.
/var(This is actually stored in /private/var; /var is really just a symbolic link.)
Sometimes processes controlled by the operating system need a place to storevariable files. Processes like printing and programs that store log files will use subdirectories in the /var directory to store those files.
It also holds a fair bit of configuration information (especially in /var/db).
/var/backupsUsed to store backups of critical system information (mainly, the nightly dumps of NetInfo databases).
/var/dbHolds various databases of system information. The most notable are the NetInfo databases (stored in /var/db/netinfo), shadow password files (in /var/db/shadow/hash), and the system's network configuration database (/var/db/SystemConfiguration/preferences.xml - although it moved to /Library/Preferences/SystemConfiguration/ in 10.3), which together store much of the system and network configuration information that a traditional unix admin would expect to find in /etc, and a Mac OS 9 admin would expect to find in System Folderreferences.
/var/logThis is where many of the system event logs are kept (others are kept in /Library/Logs).
/var/rootThe root (superuser) account's home directory. Note that this directory will exist even if you haven't enabled the root account.
/var/runStores various status information about processes (especially daemons) running on the system.
/var/tmpA place for programs to store temporary data, just like /tmp. Some programs use one, some use the other, so Mac OS X provides both.
/var/vmUsed to store the swap files for Mac OS X's virtual memory.
/var/vm/app_profileHolds information about various applications' virtual memory useage.
/VolumesThe /Volumes directory is the mount point for all of the drives (other than the boot volume) connected to the system. The Finder hides the Volumes directory itself, but displays its contents at the Computer level.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-218311-1-1.html 上篇帖子: mac new shortcut key 下篇帖子: 好好学python--os.path模块常用方法详解
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表