
FreeBSD 命令手册页(manual
pages)简体中文译文之
General Commands Manual Pages -- ls
FreeBSD 版本:Release 6.1
##############################################################################
以下为英文原文,用以与中文译文对照。之后为简体中文译文。英文原文手册页参见
http://www.freebsd.org/docs/man.html
其中包括各种版本的所有命令。
LS(1) FreeBSD General Commands Manual LS(1)
NAME
ls -- list directory contents
SYNOPSIS
ls [-ABCFGHILPRSTWZabcdfghiklmnopqrstuwx1] [file ...]
DESCRIPTION
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,
asso-
ciated information.
If no operands are given, the contents of the current directory are
dis-
played. If more than one operand is given, non-directory operands
are
displayed first; directory and non-directory operands are sorted
sepa-
rately and in lexicographical order.
The following options are available:
-A List all entries except for . and ... Automatically set for
the
super-user unless -I is specified.
-B Force printing of non-printable characters (as defined by
ctype(3) and current locale settings) in file names as \xxx,
where xxx is the numeric value of the character in octal.
-C Force multi-column output; this is the default when output is
to
a terminal.
-F Display a slash (`/') immediately after each pathname that is
a
directory, an asterisk (`*') after each that is executable, an
at
sign (`@') after each symbolic link, an equals sign (`=')
after
each socket, a percent sign (`%') after each whiteout, and a
ver-
tical bar (`|') after each that is a FIFO.
-G Enable colorized output. This option is equivalent to
defining
CLICOLOR in the environment. (See below.)
-H Symbolic links on the command line are followed. This option
is
assumed if none of the -F, -d, or -l options are specified.
-I Prevent -A from being automatically set for the
super-user.
-L If argument is a symbolic link, list the file or directory
the
link references rather than the link itself. This option
cancels
the -P option.
-P If argument is a symbolic link, list the link itself rather
than
the object the link references. This option cancels the -H
and
-L options.
-R Recursively list subdirectories encountered.
-S Sort by size (largest file first) before sorting the operands
in
lexicographical order.
-T When used with the -l (lowercase letter ``ell'') option,
display
complete time information for the file, including month, day,
hour, minute, second, and year.
-W Display whiteouts when scanning directories.
-Z Display each file's MAC label; see maclabel(7).
-a Include directory entries whose names begin with a dot
(.).
-b As -B, but use C escape codes whenever possible.
-c Use time when file status was last changed for sorting or
print-
ing.
-d Directories are listed as plain files (not searched
recursively).
-f Output is not sorted.
-g This option is deprecated and is only available for
compatibility
with 4.3BSD; it was used to display the group name in the
long
(-l) format output.
-h When used with the -l option, use unit suffixes: Byte,
Kilobyte,
Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce
the
number of digits to four or fewer using base 2 for sizes.
-i For each file, print the file's file serial number (inode
num-
ber).
-k This has the same effect as setting environment variable
BLOCKSIZE to 1024, except that it also nullifies any -h
options
to its left.
-l (The lowercase letter ``ell''.) List files in the long
format,
as described in the The Long Format subsection below.
-m Stream output format; list files across the page, separated
by
commas.
-n Display user and group IDs numerically rather than converting
to
a user or group name in a long (-l) output.
-o Include the file flags in a long (-l) output.
-p Write a slash (`/') after each filename if that file is a
direc-
tory.
-q Force printing of non-graphic characters in file names as
the
character `?'; this is the default when output is to a
terminal.
-r Reverse the order of the sort.
-s Display the number of blocks used in the file system by
each
file. Block sizes and directory totals are handled as
described
in The Long Format subsection below, except (if the long
format
is not also requested) the directory totals are not output
when
the output is in a single column, even if multi-column output
is
requested.
-t Sort by time modified (most recently modified first) before
sort-
ing the operands in lexicographical order.
-u Use time of last access, instead of last modification of the
file
for sorting (-t) or printing (-l).
-w Force raw printing of non-printable characters. This is
the
default when output is not to a terminal.
-x The same as -C, except that the multi-column output is
produced
with entries sorted across, rather than down, the columns.
-1 (The numeric digit ``one''.) Force output to be one entry
per
line. This is the default when output is not to a terminal.
The -1, -C, -x, and -l options all override each other; the last
one
specified determines the format used.
The -c and -u options override each other; the last one specified
deter-
mines the file time used.
The -B, -b, -w, and -q options all override each other; the last
one
specified determines the format used for non-printable
characters.
The -H, -L and -P options all override each other (either partially
or
fully); they are applied in the order specified.
By default, ls lists one entry per line to standard output; the
excep-
tions are to terminals or when the -C or -x options are
specified.
File information is displayed with one or more <blank>s
separating the
information associated with the -i, -s, and -l options.
The Long Format
If the -l option is given, the following information is displayed
for
each file: file mode, number of links, owner name, group name, MAC
label,
number of bytes in the file, abbreviated month, day-of-month file
was
last modified, hour file last modified, minute file last modified,
and
the pathname.
If the modification time of the file is more than 6 months in the
past or
future, then the year of the last modification is displayed in
place of
the hour and minute fields.
If the owner or group names are not a known user or group name, or
the -n
option is given, the numeric ID's are displayed.
If the file is a character special or block special file, the major
and
minor device numbers for the file are displayed in the size field.
If
the file is a symbolic link the pathname of the linked-to file is
pre-
ceded by ``->''.
The listing of a directory's contents is preceded by a labeled
total num-
ber of blocks used in the file system by the files which are listed
as
the directory's contents (which may or may not include . and ..
and other
files which start with a dot, depending on other options).
The default block size is 512 bytes. The block size may be set
with
option -k or environment variable BLOCKSIZE. Numbers of blocks in
the
output will have been rounded up so the numbers of bytes is at
least as
many as used by the corresponding file system blocks (which might
have a
different size).
The file mode printed under the -l option consists of the entry
type and
the permissions. The entry type character describes the type of
file, as
follows:
b Block special file.
c Character special file.
d Directory.
l Symbolic link.
s Socket link.
p FIFO.
- Regular file.
The next three fields are three characters each: owner permissions,
group
permissions, and other permissions. Each field has three character
posi-
tions:
1. If r, the file is readable; if -, it is not readable.
2. If w, the file is writable; if -, it is not writable.
3. The first of the following that applies:
S If in the owner permissions, the file is not exe-
cutable and set-user-ID mode is set. If in the
group permissions, the file is not executable and
set-group-ID mode is set.
s If in the owner permissions, the file is exe-
cutable and set-user-ID mode is set. If in the
group permissions, the file is executable and set-
group-ID mode is set.
x The file is executable or the directory is search-
able.
- The file is neither readable, writable, exe-
cutable, nor set-user-ID nor set-group-ID mode,
nor sticky. (See below.)
These next two apply only to the third character in the last
group (other permissions).
T The sticky bit is set (mode 1000), but not execute
or search permission. (See chmod(1) or
sticky(8).)
t The sticky bit is set (mode 1000), and is search-
able or executable. (See chmod(1) or sticky(8).)
The next field contains a plus (`+') character if the file has an
ACL, or
a space (` ') if it does not. The ls utility does not show the
actual
ACL; use getfacl(1) to do this.
ENVIRONMENT
The following environment variables affect the execution of
ls:
BLOCKSIZE If this is set, its value, rounded up to 512 or down to
a
multiple of 512, will be used as the block size in bytes
by the -l and -s options. See The Long Format subsection
for more information.
CLICOLOR Use ANSI color sequences to distinguish file types.
See
LSCOLORS below. In addition to the file types mentioned
in the -F option some extra attributes (setuid bit set,
etc.) are also displayed. The colorization is dependent
on a terminal type with the proper termcap(5) capabili-
ties. The default ``cons25'' console has the proper
capabilities, but to display the colors in an xterm(1),
for example, the TERM variable must be set to
``xterm-color''. Other terminal types may require simi-
lar adjustments. Colorization is silently disabled if
the output is not directed to a terminal unless the
CLICOLOR_FORCE variable is defined.
CLICOLOR_FORCE Color sequences are normally disabled if the output
is
not directed to a terminal. This can be overridden by
setting this flag. The TERM variable still needs to ref-
erence a color capable terminal however otherwise it is
not possible to determine which color sequences to use.
COLUMNS If this variable contains a string representing a
decimal
integer, it is used as the column position width for dis-
playing multiple-text-column output. The ls utility cal-
culates how many pathname text columns to display based
on the width provided. (See -C and -x.)
LANG The locale to use when determining the order of day and
month in the long -l format output. See environ(7) for
more information.
LSCOLORS The value of this variable describes what color to
use
for which attribute when colors are enabled with
CLICOLOR. This string is a concatenation of pairs of the
format fb, where f is the foreground color and b is the
background color.
The color designators are as follows:
a black
b red
c green
d brown
e blue
f magenta
g cyan
h light grey
A bold black, usually shows up as dark grey
B bold red
C bold green
D bold brown, usually shows up as yellow
E bold blue
F bold magenta
G bold cyan
H bold light grey; looks like bright white
x default foreground or background
Note that the above are standard ANSI colors. The actual
display may differ depending on the color capabilities of
the terminal in use.
The order of the attributes are as follows:
1. directory
2. symbolic link
3. socket
4. pipe
5. executable
6. block special
7. character special
8. executable with setuid bit set
9. executable with setgid bit set
10. directory writable to others, with sticky bit
11. directory writable to others, without sticky
bit
The default is "exfxcxdxbxegedabagacad", i.e., blue fore-
ground and default background for regular directories,
black foreground and red background for setuid executa-
bles, etc.
LS_COLWIDTHS If this variable is set, it is considered to be a
colon-
delimited list of minimum column widths. Unreasonable
and insufficient widths are ignored (thus zero signifies
a dynamically sized column). Not all columns have
changeable widths. The fields are, in order: inode,
block count, number of links, user name, group name,
flags, file size, file name.
TERM The CLICOLOR functionality depends on a terminal type
with color capabilities.
TZ The timezone to use when displaying dates. See
environ(7) for more information.
EXIT STATUS
The ls utility exits 0 on success, and >0 if an error
occurs.
COMPATIBILITY
The group field is now automatically included in the long listing
for
files in order to be compatible with the IEEE Std 1003.2
(``POSIX.2'')
specification.
SEE ALSO
chflags(1), chmod(1), getfacl(1), sort(1), xterm(1),
termcap(5),
maclabel(7), symlink(7), getfmac(8), sticky(8)
STANDARDS
With the exception of options -I, -g, -n and -o, the ls utility
conforms
to IEEE Std 1003.1-2001 (``POSIX.1'').
The ACL support is compatible with IEEE Std 1003.2c
(``POSIX.2c'')
Draft 17 (withdrawn).
HISTORY
An ls command appeared in Version 1 AT&T UNIX.
BUGS
To maintain backward compatibility, the relationships between the
many
options are quite complex.
The exception mentioned in the -s option description might be a
feature
that was based on the fact that single-column output usually goes
to
something other than a terminal. It is debatable whether this is
a
design bug.
FreeBSD 6.1 November 16, 2005 FreeBSD 6.1
##############################################################################
下面即为命令ls的简体中文译文。
##############################################################################
LS(1) FreeBSD普通命令手册 LS(1)
名称(NAME)
ls -- 列出目录内容
大纲(SYNOPSIS)
ls [-ABCFGHILPRSTWZabcdfghiklmnopqrstuwx1] [file ...]
描述(DESCRIPTION)
对每个不同于目录类型的称为文件的操作数,ls显示出它的名称以及任何请求的、相
关的信息。对每个称为目录型文件的操作数,ls显示出包含于目录中的文件名,以及
任何请求的、相关的信息。
若没有给出操作数,则当前目录的内容将被显示出来。若给出不只一个操作数,则非
目录的操作数将首先被显示出来;目录和非目录操作数将分别以词典编纂顺序排列。
下面的选项是可用的:
- A
列出全部条目,除了“.”和“..”之外。自动设置为超级用户,除非–I被指定。
- B
强制非可打印字符(像ctype(3)定义和当前现场设置)以文件名\xxx格式打印,此
处的xxx是8进制字符的数字值。
- C 强制多列输出,当输出给一个终端时,此为默认。
- F
在每个路径名称之后紧跟着显示一个斜杠(‘/’),在每个可执行的文件名称之后
显示一个星号(‘*’),在每个符号链接后显示一个“在”标志(‘@’),在每个
套接字后显示一个等于号(‘=’),在每个空白处后面显示一个百分号(‘%’),
在每个FIFO之后显示一个竖杠(‘|’)。
- G
允许彩色输出,此选项等价于在环境变量中定义CLICOLOR。(见下)
- H
命令行上的符号链接将被跟随,此选项假定选项-F、-d或-l中没有一个被给出。
- I 阻止-A被自动设置成超级用户。
- L
若论据是一个符号链接,列出涉及的文件或目录好于链接自身。此选项取消了-P
选项。
- P
若论据是一个符号链接,列出链接自身好于涉及的文件或目录。此选项取消了–H
和-P选项。
- R 递归列出遇到的子目录。
- S 以词典编纂顺序给操作数排序之前,按大小排序(大文件优先)。
- T
带-l选项使用时,给文件显示出完整的时间信息,包括年月日、时分秒。
- W 扫描目录时显示空白。
- Z 显示每个文件的MAC标签。参见maclabel(7)。
- a 包括名称以点形状的目录条目。
- b 像–B,但尽可能使用C逃脱代码。
- d 目录被显示为普通文件(并不递归查找)。
- f 输出不被排序。
- g
此选项不赞成使用,而且只对4.3版BSD的兼容性有效;其通常用于显示长(-l)
格式输出中的组名。
- h
带-l选项使用时,用单位后缀:Byte、Kilobyte、Megabyte、Gigabyte、Terabyte
和Petabyte来缩减数值位数到4位,或更少到用基数2位做为大小。
- i 对每个文件打印出文件的序号(节点号)。
- k
与设置环境变量BLOCKSIZE到1024有同样效果。此外,任意一个-h选项在它的
左边,其也会失效。
- l (小写字母“ell”)以长格式列出文件,在The Long
Format子段落下有详细叙述。
- m 流输出格式;列出跨页的、以逗号分隔的文件。
- n
以数字显示用户或组的标识符,好于转换成长格式(-l)输出中的用户名或组名。
- o 包括以长格式(-l)输出的文件标志。
- p 若文件是一个目录,在每个文件名之后显示一个斜杠(‘/’)。
- q
强制文件名的非图形字符(像字符‘?’)的打印,当输出给一个终端时,此为默
认。
- r 逆转排列的顺序。
- s
显示文件系统中被每个文件使用的块数,地的大小和目录总数受到掌控,在The
Long
Format子段落下有详述,此外(若并不要求长格式)当输出是单独一列时,
目录总数并不输出,甚至是在要求多列输出时。
- t
在以词典编纂顺序排列操作数之前,通过修改的时间(最近期修改的优先)排列。
- u
使用最近的访问时间,代替文件的最近修改时间做为排列(-t)或打印(-l).
- w 强制非可打印字符以行格式打印,当输出给终端时,此为默认。
- x 像-c一样,除了多列输出以跨列(好于向下)排序的条目增加。
- 1
(数字“1”)强制输出为每行一个条目,当输出不对终端时,此为默认。
选项-1、-C、-x和-l彼此全都覆盖。指定的最后一个决定使用的格式。
选项-c和-u彼此覆盖,指定的最后一个决定使用的文件时间。
选项-B、-b、-w和-q彼此全都覆盖。指定的最后一个决定用于非可打印字符的格式。
选项-H、-L和-P彼此全都覆盖(或部分地或全部地)。它们应用于指定的目的。
在默认情况下,ls每行列出一条到标准输出,例外的是,给终端或当选项-C与-x被指
定时。
文件信息以一个或多个空白分离的、且与选项-i、-s和-l相关的信息显示出来。
长格式(The Long Format)
若选项-l被给出,接下来的信息为每个文件显示出来:文件模式、链接数、所有者名、
组名、MAC标签、文件的字节数、缩写的月份、被最近修改的日期月份文件、最近修改
的小时文件、最近修改的分钟文件,以及路径名。
若文件的修改时间大于过去的或将来的6个月时间,则最后修改的年份将显示在小时和
分钟域的位置。
若所有者或组名不是一个书籍的用户或组名,或者-n被给出,数字形式的标识符将被显
示出来。
若文件是一个字符形或块形特殊文件,给文件的主要及次要设置数将显示在大小域。若
文件是一个符号链接,则链接到文件的路径名将在“->”之前出现。
目录内容的列出是在标识出的、被文件在文件系统中使用的数据块的总数之前出现的,
此处的文件是做为目录的内容而列出(目录内容也许会或不会包括.与..以及其他以点开
始的、依赖其他选项的文件)。
默认块大小是512字节,块大小可以和选项-K或环境变量一起设置。输出中的块数将会
被聚集,因此字节数至少像类似的文件系统块(其也许有不同的大小)一样多。
在选项-l下打印的文件模式由条目类型和权限组成。条目类型字符描述文件类型,如下:
b 块形特殊文件
c 字符形特殊文件
d 目录
l 符号链接
s 套接字链接
P FIFO先入先出
- 常规文件
接下来的三个区域是每个域三个字符:所有权限、组权限和其他权限。每个域有三个字
符位:
1. 若r,文件可读;若-,其不可读。
2. 若w,文件可写;若-,其不可写。
3. 下面中的头一个,其应用:
S
若在所有者权限内,文件不可执行并且用户标志模式是设置的。若在组
权限内,此文件不可执行并且给身份模式是设置的。
s
若在所有者权限内,文件不可执行,并且用户标志模式是设置的。若在
组权限内,文件是可执行的,并且组标志模式是设置的。
x 文件是可执行的或目录是可查找的。
-
文件既不能读、写、执行,也不是用户标志模式、组标志模式、黏性模
式(见下)。
下面的这两个只应用于最后一组(其他权限)中的敏感字符。
T
黏性位被设置(1000模式),但并不执行或查找权限。(参见chmod(1)或
sticky(8)。)
t 黏性位被设置(1000模式),并且是可查找的或可执行的。(参见在
chmod(1)或sticky(8)。)
若文件有一个ACL,下面的域包含一个“加”(‘+’)字符,或者若没有,则是一个空格
(‘ ’)。工具ls并不显示确切的ACL,使用getfacl(1)去做这个。
环境(ENVIRONMENT)
下面的环境变量会影响ls的执行:
BLOCKSIZE
若其被设置,它的值--—聚集到512或下降至512的倍数--—将被选
项-l和-s以字节做为块大小来使用。参见长格式子段获得更多信息。
CLICOLOR
用ANSI颜色顺序来区分文件类型。参见下面的LSCOLOR。此外在选项
-F中提到的文件类型---一些额外的属性(setuid位设置,等等)也会
显示出来。彩色化依赖于适当的tercap(1)兼容性一致的终端类型。
默认的控制台“”具有适当的兼容性,但在一个X(1)中显示彩色。例
如变量TERM必须设置成“”。其他终端类型也许需要相似的调整。若
输出并不直接给终端,彩色化是暗中禁用的,除非变量
CLICOLOR_FORCE得到定义。
CLICOLOR_FORCE
若输出并不直接给终端,颜色顺序通常不可用。其可以通过设置此标
志来覆盖。变量TERM无论如何仍然需要参考一个具有彩色能力的终
端。否则不可能决定使用哪种颜色顺序。
COLUMNS
若此变量包含一个声名为整数的字符串,其像列宽一样用于显示多个
文本列输出。工具ls计算出基于提供的宽度显示多少路径名文本列。
(参见-C和-x)
LANG
当场使用,当确定长格式-l输出中年月的顺序时。参见enviror(7)
获得更多信息。
LSCOLORS
当颜色带CLICOLOR可用时,此变量值描述用于哪个属性的什么颜色。
此字符串是数对fb格式的相关物,此处f是前景色,而b是背景色。
颜色如下:
a 黑
b 红
c 绿
c 棕
d 蓝
f 紫红
g 青
h 浅灰
A 粗黑,通常显示成灰黑
B 粗红
C 粗绿
D 粗棕
E 粗蓝
F 粗紫红
G 粗青
H 粗浅灰,看起来像亮白
X 默认前景或背景色
注意,以上是标准ANSI颜色。真实地显示也许不同,这依赖于使用中
终端的颜色兼容性。
属性的顺序如下:
1. 目录
2. 符号链接
3. 套接字
4. 管道
5. 可执行的
6. 块形特例
7. 字符形特例
8. 带setuid位设置的可执行的
9. 带setgid位设置的可执行的
10. 带黏性位的对其他人可写的目录
11. 无黏性位的对其他人可写的目录
默认是“exfxcxdxbxegedabagacad”,蓝色前景和默认背景给常规目
录,黑色前景和红色背景给setuid可执行的,等等。
LS_COLWIDTHS
若此变量被设置,其被认为是一个最小列宽的冒号界定的列表。不合
理的和不重要的宽度将被忽略(因此零标识动态大小的列)。并不是所
有列具有可更改的宽度。这些域按顺序为:节点、快数、链接数、用
户名、组名、标志、文件大小、文件名。
TERM CLICOLOR功能依赖于和颜色兼容的终端类型。
TZ 当显示日期时,显示时区。参见environ(7)获得更多信息。
退出状态(EXIT STATUS)
工具ls成功时退出0,当错误发生时>0。
兼容性(COMPATIBILITY)
组域现在自动地包含在文件的长列表中,目的是与IEEE
1003.2(“POSIX.2”)标准特殊
性兼容的。
另外参见(SEE ALSO)
chflags(1), chmod(1), getfacl(1), sort(1), xterm(1),
termcap(5),maclabel(7),
symlink(7), getfmac(8), sticky(8)
标准(STANDARDS)
除了选项-I、-g、-h和-o,工具ls遵从IEE1003.1-2001(“POSIX.1”)标准。
ACT支持与IEEE 1003.2c(“POSIX.2c”)标准草案(撤回)相兼容。
历史(HISTORY)
ls命令出现于AT&T UNIX第一版。
错误(BUGS)
维持向后兼容性,许多选项之间的关系是十分复杂的。
在-s描述中提到的例外情况,也许是一个特色,此特色基于这样的实情,即单列输出通
常转到不同于终端的地方。这是否为一个设计错误还是一个争议。
FreeBSD 6.1 2005年11月6日 FreeBSD 6.1
##############################################################################
后记
翻译此文,其实并未太费周折。本人只是利用了一些零碎时间,积少成多,不经意间自然而然地就完成了。译完后,搁置了几天,待头脑从兴奋状态中冷静下来后,回头再校对了一番,又从中发现了一些毛病。限于本人英文水平有限,就劳驾了一个英文高手(可能还没有读者高!^_^)帮忙进行了校译。至此,前后竟然耗费了很多时日,不过还好,现在总算完成了。译文中的出入,敬请读者积极纠偏指正。
之所以从命令ls入手,现在想起来,缘起于十年前的一个小故事。
1997年,虽然Windows
95已经面世,但在中国还未形成流行之势,在社会生活的各个领域,微机的中的OS仍然是DOS大行其道。这一年,一位学计算机专业的仁兄和我同期毕业了。次年,我们各自找到了一份稳定的工作。也只有在单位里,我们才有可能接触到电脑,因为我们还舍不得花“巨款”买一台属于自己的486。一天,我想要拷贝一个小程序,于是找到这位仁兄。这斯二话不说,手法极其娴熟地开始敲击键盘,却见他启动了一个不相干的程序,我十分诧异地问他要干嘛,只见他目不转睛地盯着电脑屏幕,回了一句稍等便无遐理我,稍后见他打开一个界面,输入了我要拷贝的程序,稍逊,屏幕上出现了程序所在的路径。此时我才恍然大悟,他是在用此程序实现查找文件的功能啊!顿时引起我一阵爆笑。其实,在DOS下,每个初学者学到的第一个最基本的命令dir,就可以实现查找文件的功能。
事后,心底却有了一丝凉意。也许他看过的中文DOS手册里就没有关于这一功能的详细说明;也许他太没有耐性,对命令的英文帮助没有细看;也许这只是个偶然......不想再找太多借口了。但我从不怀疑他对电脑的热情,因为他久坐而堆积出来的硕大的屁股就是例证之一。如此专业级的发烧友尚且如此,那么还有谁、有多少人比他更能了解电脑呢?可想而知,中文详尽资料的匮乏和英文这个巨大屏障,严重地屏蔽了太多发烧友们的热情,所以,我们的步伐才总是落在外国人的屁股后面,甚至是台湾人的后面。
不知不觉间,此事已经过去十年了,至今久久不忘,没想到今天有幸讲出来,由此才引发从翻译命令ls入手的想法。但愿能给大家一点点启迪,也算是对得起我写的这些字了。
题外话
为什么选择FreeBSD或Linux,而放弃Windows?
FreeBSD和Linux等其他类UNIX的操作系统,虽然都是免费且开源的,但却十分精致,而且在性能上甚至超越了Windows。有关Windows的种种事宜,这里就不必一一点评了,这里只简单阐述两个问题。
就费用而言,我们花费在Windows上的社会财富可以毫不夸张地说,无以计数,而且更重要的是,未来的很大一部分社会财富已经固定地流向了Windows--无底洞啊!
还有,不仅仅在物质层面我们付出了高昂的代价,就智力资源而言,大量的脑力劳动消耗在对Windows核心技术的认知上--Windows可是一个大大的黑箱啊!如果只是黑箱还可以克服,可是其外表却包裹了一层语言屏障。双重障碍,国人裹足前行,由此,国产的软件很少具有与国际一流软件产品齐肩的品质,更何谈超越了。
难道我们甘愿如此吗?
我们不是没有选择--
FreeBSD和Linux是免费的!
FreeBSD和Linux的代码是昭然天下的!
FreeBSD和Linux的水准是高于Windows的!
若我们足以充分利用此二者,则原来用以购买Windwos软件产品的社会财富和广大的智力资源,就会由原来的对外投入转变为积极强大的内燃力--社会推动力。前景美好吧!我们何乐而不为呢?!
可是(又要转折了),为什么有这么好的机遇,国内FreeBSD和Linux的推广却步履维艰呢?
遥想当年Windows面世的时候,大家也对它懵懵懂懂,但却挡不住普及式的使用手册铺天盖地充斥了各种书籍市场,而且经过多年的历练,玩Windows的高手现如今也已经比比皆是了。
不过,今非昔比,树荫下成长的小树苗必然先天营养不足,如何扭转乾坤?Linux可以说做得很好,至少在书店里可以见到一些像样的手册。而且,Linux的世界已经在很多人的电脑里发光耀眼了。FreeBSD虽是后起之秀,却不见明显征兆。FreeBSD!究竟怎么玩啊?有谁能教教我吗?就像老话说的,想说爱你不容易啊!并不是每个人都愿意去耗费精力,去研磨英文。有谁能够找到一本让国人信手捏来看得懂的“手册”吗?只要有一本这样的手册,我就不信玩不出花样来!打个比方,三维立体的桌面,我们也可以做得出来!
可以肯定的是,FreeBSD和Linux会有足够顽强的生命力存在下去的。这个世界同样地也可以造就FreeBSD和Linux的天下盛世。
但愿我没有白忙!!!
----------------------------------
teYqiu【天下无毒】原创文章,转载请标明。http://hi.baidu.com/teyqiu
百度知道反病毒知识专家崔衍渠 授权。
『转载请保留此申明!』
----------------------------------
本帖原始地址:http://hi.baidu.com/teyqiu/blog/item/cc0f7bf435db43d8f2d38577.html
注意更新!
用途:收集不能一眼识别但却是良民的部分正常注册表、服务、驱动项目

一、注册表项目
1.01 透明网关认证程序
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
<renzheng><C:\renzheng\webaClient.exe>
[]
1.02
如下三项为Nvida显卡相关
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
<NvCplDaemon><RUNDLL32.EXE
C:\WINDOWS\system32\NvCpl.dll,NvStartup> [N/A]
<NvMediaCenter><RUNDLL32.EXE
C:\WINDOWS\system32\NvMcTray.dll,NvTaskbarInit>
[N/A]
<nwiz><nwiz.exe
/install>
[N/A]
1.03 如下几项均为IBM笔记本系列的正常组件的启动
当然可以考虑屏蔽不建议删除。
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\Notify\tpfnf2]
<WinlogonNotify:
tpfnf2><notifyf2.dll>
[]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\Notify\tphotkey]
<WinlogonNotify:
tphotkey><tphklock.dll>[]
1.04
壁纸自动换
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
<switch><c:\windows\system32\壁纸自动换.exe>
[]
<switch><c:\windows\system32\bgswitch.exe>
[]
1.05 摄像头
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
<BigDogPath><C:\WINDOWS\VM_STI.EXE VIMICRO USB PC
Camera>
[N/A]
1.06
windows致命错误修复
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
<KernelFaultCheck><%systemroot%\system32\dumprep 0
-k>
[N/A]
1.07
木马克星软件
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
NT\CurrentVersion\Windows]
<AppInit_DLLs><APIHookDll.dll>
[N/A]
二、服务
2.01 XP
人机接口设备
[Human Interface Device Access / HidServ][Stopped/Manual
Start]
<C:\windows\System32\svchost.exe -k
netsvcs-->%SystemRoot%\System32\hidserv.dll><N/A>
2.02 Windows帮助中心
[Help and Support / helpsvc][Stopped/Disabled]
<C:\windows\System32\svchost.exe -k
netsvcs-->%WINDIR%\PCHealth\HelpCtr\Binaries\pchsvc.dll><N/A>
2.03 如下为IBM笔记本的正常组件的服务启动
可根据需要屏蔽部分但不建议删除。
[Ac Profile Manager Service / AcPrfMgrSvc][Running/Auto
Start]
<C:\Program
Files\ThinkPad\ConnectUtilities\AcPrfMgrSvc.exe><N/A>
[Access Connections Main Service / AcSvc][Running/Auto Start]
<C:\Program
Files\ThinkPad\ConnectUtilities\AcSvc.exe><Lenovo>
[ThinkPad PM Service / IBMPMSVC][Running/Auto Start]
<C:\WINDOWS\system32\ibmpmsvc.exe><>
[IBM KCU Service / TpKmpSVC][Running/Auto Start]
<C:\WINDOWS\system32\TpKmpSVC.exe><N/A>
2.04
ATI显卡
[ATI Smart / ATI Smart][Stopped/Auto Start]
<C:\WINDOWS\system32\ati2sgag.exe><>
2.05
用友财务软件
[UfAutoLoadService / UfAutoLoadService][Stopped/Auto Start]
<C:\WINDOWS\system32\UfAutoLoadService.exe><>
[UfMsgGhost / UfMsgGhost][Running/Auto Start]
<C:\WINDOWS\system32\MsgGhost.exe><>
[U8AuthServer / UFNet][Running/Auto Start]
<C:\WINDOWS\system32\ServerNT.exe><N/A>
2.06 某摄像头的服务
[STI Simulator / STI Simulator][Running/Auto Start]
<C:\WINDOWS\System32\PAStiSvc.exe><N/A>
2.07 时创网络动态域名系统
[Cyberip / Cyberip][Stopped/Manual Start]
<G:\itsys\CyberIP.exe><>
[Cyberlink RichVideo Service(CRVS) / RichVideo][Stopped/Manual
Start]
<"D:\Program
Files\Cyberlink\Shared Files\RichVideo.exe"><>
2.08
影子系统powershadow
[Shadow System Service /
ShadowSystemService][Stopped/Manual Start]
<D:\WINDOWS\system32\shadow\ShadowService.exe><N/A>
2.09 某读卡器
[O2Micro Flash Memory / O2Flash][Running/Auto Start]
<C:\WINDOWS\system32\o2flash.exe><N/A>

三、驱动
3.01 ALi mini IDE Driver provided by Acer Laboratories
Inc
[AliIde / AliIde][Stopped/Boot
Start]
<\SystemRoot\System32\DRIVERS\aliide.sys><N/A>
[atitray / atitray][Stopped/System Start]
<\??\e:\NGOATI~1.3\ATT\atitray.sys><N/A>
3.02 Macrovision SECURITY
Driver
[Secdrv / Secdrv][Stopped/Manual
Start]
<system32\DRIVERS\secdrv.sys><N/A>
3.03 VIA AC'97 Audio
Controller
[VIA AC'97 Audio Controller (WDM) / VIAudio][Stopped/Manual
Start]
<system32\drivers\viaudio.sys><N/A>
3.04 天网防火墙
[SKNFW / SKNFW][Running/System Start]
<\??\C:\WINDOWS\system32\Drivers\SKNFW.sys><N/A>
[SkyProcs / SkyProcs][Stopped/Manual Start]
<\??\C:\PROGRA~1\SkyNet\Firewall\SkyProcs.sys><N/A>
3.05
USB摄像头
[USB PC
Camera (SNPSTD3) / SNPSTD3][Stopped/Manual Start]
<system32\DRIVERS\snpstd3.sys><>
[USB PC Camera 301P / ZSMC301b][Stopped/Manual Start]
<System32\Drivers\usbVM31b.sys><VM>
[Teclast WE PC Camera / ZSMC301b][Running/Manual Start]
<System32\Drivers\usbVM31b.sys><VM>
[Jollytime PC Camera / ZSMC301b][Stopped/Manual Start]
<System32\Drivers\usbVM31b.sys><VM>
[USB Data Cable / usb2vcom][Stopped/Manual Start]
<system32\DRIVERS\usb2vcom.sys><>
3.06 sptd.sys是daemon
tools虚拟光驱的一个文件
[sptd / sptd][Running/Boot Start]
<\SystemRoot\System32\Drivers\sptd.sys><N/A>
[dtscsi / dtscsi][Running/Manual Start]
<\SystemRoot\System32\Drivers\dtscsi.sys><N/A>
[d347bus / d347bus][Running/Boot Start]
<\SystemRoot\system32\DRIVERS\d347bus.sys><>
[d347prt / d347prt][Running/Boot Start]
<\SystemRoot\System32\Drivers\d347prt.sys><>
3.07 QQ加密键盘的几个驱动
[npkcrypt / npkcrypt][Stopped/Auto Start]
<\??\C:\Program
files\Tencent\QQ\npkcrypt.sys><N/A>
[npkcusb / npkcusb][Stopped/Auto Start]
<\??\C:\Program
files\Tencent\QQ\npkcusb.sys><N/A>
[npkcrypt / npkcrypt][Running/Auto Start]
<\??\C:\Program Files\Tencent\QQ\npkcrypt.sys><INCA
Internet Co., Ltd.>
3.08 The
SCSI/RAID Host Controller driver by Microtek
Lab
[SMPLSCSI / SMPLSCSI][Stopped/Boot Start]
<\SystemRoot\System32\drivers\SMPLSCSI.SYS><N/A>
3.09
招商银行网上银行大众版登录插件
[CMBProtector /
CMBProtector][Running/Auto Start]
<\??\D:\WINDOWS\system32\Drivers\CMBProtector.dat><N/A>
3.10 某主板驱动
[3WAREDRV / 3WAREDRV][Stopped/Boot Start]
<\SystemRoot\System32\DRIVERS\3WAREDRV.SYS><N/A>
[3WAREGSM / 3WAREGSM][Stopped/Boot Start]
<\SystemRoot\System32\DRIVERS\3waregsm.sys><N/A>
[3WDRV100 / 3WDRV100][Stopped/Boot Start]
<\SystemRoot\System32\DRIVERS\3WDRV100.SYS><N/A>
3.11 AntiARP
Sniffer的驱动
[oreans32 / oreans32]
<\??\C:\WINDOWS\system32\drivers\oreans32.sys><N/A>
3.12
NTPort.Library: NTPort Library
允许你的Win32程序实时直接访问PC机的I/O端口而无须使用Windows Drivers Development Kit(DDK)
或其他工具。NTPort Library非常容易使用:在Windows
NT/2000/XP下,NTPort Library
驱动程序可以动态地加载和卸载,你不需要做任何设置工作。NTPort
Library也是BASIC的INP或OUT命令的替代品。NTPort
Library还可以获得LPT端口的基地址。
[NTPort Library Driver / zntport][Stopped/Auto Start]
<\??\C:\WINDOWS\system32\zntport.sys><N/A>
3.13 某读卡器
[O2MDRDR /
O2MDRDR][Running/Boot Start]
<\SystemRoot\system32\DRIVERS\o2media.sys><O2Micro>
[O2SDRDR / O2SDRDR][Running/Boot Start]
<\SystemRoot\system32\DRIVERS\o2sd.sys><O2Micro>

四、其他(BHO、启动文件夹等)
4.01 如下为惠普打印机的驱动
正在运行的进程中可以看到注入:
[PID:
472][C:\WINNT\system32\spoolsv.exe]
[Microsoft Corporation, 5.00.2195.7059]
[C:\WINNT\system32\HPBMMON.DLL]
[Hewlett-Packard, 10.00.16]
[C:\WINNT\system32\hpdomon.dll]
[Hewlett-Packard, 03.42.00]
[C:\WINNT\system32\HPBHealr.dll]
[N/A, N/A]
[C:\WINNT\system32\spool\PRTPROCS\W32X86\hpzpp041.dll]
[Hewlett-Packard Corporation, 60.041.41.00]
今天在处理一个关于文件系统损坏的问题,于是翻出来了一篇文章,与大家共享!
正文:
众所周知,文件系统是操作系统最为重要的一部分。每种操作系统都有自己的文件系统。文件系统直接影响着操作系统的稳定性和可靠性。Linux下的文件系统通常有两种,即日志文件系统和非日志文件系统,以下简单介绍两类文件系统。
一、 非日志文件系统
非日志文件系统在工作时,不对文件系统的更改进行日志记录。
文件系统通过为文件分配文件块的方式把数据存储在磁盘上。每个文件在磁盘上都会占用一个以上的磁盘扇区,文件系统的工作就是维护文件在磁盘上的存放,记录文件占用了哪几个扇区。另外扇区的使用情况也要记录在磁盘上。文件系统在读写文件时,首先找到文件使用的扇区号,然后从中读出文件内容。如果要写文件,文件系统首先找到可用扇区,进行数据追加。同时更新文件扇区使用信息。不同的文件系统用不同的方法分配和读取文件块。例如,dos/windows就使用fat文件系统,而windows
NT则采用NTFS文件系统。
非日志文件系统能够工作得很稳定,但是,它存在不少问题。各位请看,对于一个普通的非日志文件系统,如Ext2文件系统,如果系统刚将文件的磁盘分区占用信息(meta-data)写入到磁盘分区中,还没有来得及将文件内容写入磁盘,这时意外发生了:系统断电了,结果会造成:文件的内容仍然是老内容,而meta-data信息是新内容,二者不一致了。
再看一下Linux系统中fsck是如何工作的:通常情况下,当 Linux
系统启动时,首先运行fsck,由它扫描/etc/fstab
文件中列出的所有本地文件系统。fsck
的工作就是确保要装载的文件系统的元数据是处于可使用的状态。当系统关闭时,fsck又把所有的缓冲区数据转送到磁盘,并确保文件系统被彻底卸载,以保证系统下次启动时能够正常使用。
然而意想不到掉电或者其它故障会导致系统死机、重启。出现这种情况时,操作系统来不及卸载文件系统。重启后,fsck对磁盘进行彻底扫描,全面地检查元数据,竭尽全能修正检查过程中能找到的所有错误。对所有的元数据做彻底的一致性检查极其耗时。文件系统越大,完成彻底的扫描时间就越长。Fsck也会碰到它无法修复的磁盘错误。碰到这种情况,就是简单地将文件删除或另存为一个文件。在高密度访问的数据中心,fsck可能会造成极大的数据文件破坏。只有当fsck
完成扫描、检查与修复工作后,Linux系统才能开始使用。当然,如果有严重的文件或数据丢失的话,系统很可能无法重新启动了!
非日志文件系统的种类:
Linux可以支持种类繁多的文件系统,几乎所有的Linux发行版都用ext2作为默认的文件系统。Ext2文件系统就是一个非日志文件系统。此外,Linux支持的其它非日志文件系统还有:FAT、VFAT、HPFS(OS/2)、NTFS(Windows
NT)、Sun的UFS等。
二、
日志式文件系统
日志文件系统则是在非日志文件系统的基础上,加入了文件系统更改的日志记录。
日志文件的设计思想是:跟踪记录文件系统的变化,并将变化内容记录入日志。日志式文件系统的思想来自于大型数据库系统。数据库操作由多个相关的、相互依赖的子操作组成,任何一个子操作的失败都意味着整个操作的无效性,所以,对数据的任何修改都要求回复到操作以前的状态。日志式文件系统