Mac 系统目录结构
2018-05-24 本文已影响7人
reboot_q
1. 终端查看 mac文件目录结构
# man hier
HIER(7) BSD Miscellaneous Information Manual HIER(7)
NAME
hier -- layout of filesystems
DESCRIPTION
A historical sketch of the filesystem hierarchy. The modern OS X 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 termcap file; see termcap(5)
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 termcap 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 describ
2. Unix ToolBox
code | description |
---|---|
# uname -a | mac系统内核版本信息 |
# uptime | 电脑自上次启动后的运行时间 |
# hostname | 电脑主机名称 |
# man hier | 查看系统目录结构 |
# last reboot | 系统最近一次的启动时间 |
# dmesg | 检测硬件boot 信息 |
# top | 查看cpu进程 |
# chmod +x xxx.txt | 设置文件权限(777) |
# df | 查看磁盘可用空间 |
# mount | column -t | 格式化显示文件系统 |
# du -sh filename
|
查看文件大小 |
# du -csh | 查看所在目录下所有文件大小 |
# du -ks directPath
|
按文件大小排序文件 |
# ls -lSr | 列出所在目录下所有文件, 子文件最多的的在最后 |
# ifconfig | grep "192." | 查看 ip |
# arp -a | 查看系统启动后连接过得 ip |
# traceroute destination | 路由跟踪 |
# ssh-keygen -t dsa -N '' cat ~/.ssh/id_dsa. pub | ssh you@host-server "cat - >> ~/.ssh/authorized_keys2" | ssh 秘钥 |
# find ./ -name "*test" | 查询文件 |
# whereis java | 查询文件目录 |
# history | tail -50 | 查询最近50条指令 |
# openssl md5 file.tar.gz | md5加密 |
# openssl sha1 file.tar.gz | sha1加密 |
# openssl rmd160 file.tar.gz | RIPEMD-160加密 |
# convert a.pdf a.png convert image000* -resample 120x120 -compress JPEG -quality 80 images.pdf
|
格式转换 |