一 : fread 中文man页面(1)
NAME
fread, fwrite - 二进制流的输入/输出
总览 (SYNOPSIS)
#include <stdio.h>
size_t fread(void *ptr, size_tsize, size_tnmemb,FILE *stream);
size_t fwrite(const void *ptr, size_tsize, size_tnmemb,FILE *stream);
描述 (DESCRIPTION)
函数fread从stream指定 的 流 里面 读取nmemb个 数据单元, 每个 单元 有size个 字节, 然后 存放在ptr指定 的 数据区.
函数fwrite向stream指定 的 流 输出nmemb个 数据单元, 每个 单元 有size个 字节, 数据 来源 由ptr指针 指出.
相应的 无锁函数(non-locking) 参见unlocked_stdio(3).
返回值 (RETURN VALUE)
fread和fwrite返回 成功 读/写 的 单元数 (也就是说, 不是字节数). 如果 出现 错误 或 到达文件末尾, 函数 返回 缩小的 单元数 (或0).
fread不能 区分 错误 和 文件末尾, 调用者 必须 通过feof(3) 和ferror(3) 判断 发生了 什么.
参考标准 (CONFORMING TO)
函数fread和fwrite遵循 ANSI X3.159-1989 (``ANSI C'').
另见 (SEE ALSO)
read(2),write(2),feof(3),ferror(3),unlocked_stdio(3)
fread 中文man页面(1)_fread
NAME
fread, fwrite - binary stream input/output
SYNOPSIS
#include <stdio.h>
size_t fread(void *ptr, size_tsize, size_tnmemb,FILE *stream);
size_t fwrite(const void *ptr, size_tsize, size_tnmemb,FILE *stream);
DESCRIPTION
The functionfreadreadsnmembelements of data, eachsizebytes long, from the stream pointed to bystream, storing them at the location given byptr.
The functionfwritewritesnmembelements of data, eachsizebytes long, to the stream pointed to bystream, obtaining them from the location given byptr.
For non-locking counterparts, seeunlocked_stdio(3).
RETURN VALUE
freadandfwritereturn the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero).
freaddoes not distinguish between end-of-file and error, and callers must usefeof(3) andferror(3) to determine which occurred.
CONFORMING TO
The functionsfreadandfwriteconform to ANSI X3.159-1989 (``ANSI C'').
SEE ALSO
read(2),write(2),feof(3),ferror(3),unlocked_stdio(3)
二 : halt 中文man页面(1)
NAME
halt, reboot, poweroff - 中止系统运行
SYNOPSIS
/sbin/halt[-n] [-w] [-d] [-f] [-i] [-p]
/sbin/reboot[-n] [-w] [-d] [-f] [-i]
/sbin/poweroff[-n] [-w] [-d] [-f] [-i]
描述
Halt将系统正在关机的信息写入/var/log/wtmp文件,然后通知内核停止重启或关机系统。如果halt或reboot是在系统没有运行在运行级别0或6,系统将调用shutdown(8) 命令(使用参数-h或-r)。
选项
- -n
- 在关机或重启之前不对系统缓存进行同步。
- -w
- 不真正重启或关机,而仅仅将关机信息写入 wtmp (在/var/log/wtmp文件里)。
- -d
- 不记录此次关机情况。当使用-n参数时隐含-d。
- -f
- 强制执行 halt 或 reboot 而不去调用shutdown(8)。
- -i
- 在关闭或重启系统之前关闭所有网络界面。
- -p
- 当关闭系统时执行关闭电源操作。当以poweroff方式调用 halt 时,此为缺省参数。
DIAGNOSTICS
If you're not the superuser, you will get the message `must be superuser'.
注意
在先前的sysvinit发布中,reboot和halt不能直接调用。从版本 2.74 开始,当系统不是运行在运行级别0或6的时侯,执行halt和reboot后实际调用的是shutdown(8) 。这就意味着如果在当前运行级别的环境中无法找到
halt或reboot的时候(比如,在/var/run/utmp 还没有正确初始化的时候),将会调用shutdown,这个结果也许非你所想。如果你想做一此硬的halt或reboot,那么使用-f参数。
作者
Miquel van Smoorenburg, miquels@cistron.nl
参见
shutdown(8),init(1)
halt 中文man页面(1)_halt
NAME
halt, reboot, poweroff - stop the system.
SYNOPSIS
/sbin/halt[-n] [-w] [-d] [-f] [-i] [-p] [-h]
/sbin/reboot[-n] [-w] [-d] [-f] [-i]
/sbin/poweroff[-n] [-w] [-d] [-f] [-i] [-h]
DESCRIPTION
Haltnotes that the system is being brought down in the file/var/log/wtmp, and then either tells the kernel to halt, reboot or poweroff the system.
Ifhaltorrebootis called when the system isnotin runlevel0or6, in other words when it's running normally,shutdownwill be invoked instead (with the-hor-rflag). For more info see theshutdown(8) manpage.
The rest of this manpage describes the behaviour in runlevels 0 and 6, that is when the systems shutdown scripts are being run.
OPTIONS
- -n
- Don't sync before reboot or halt.
- -w
- Don't actually reboot or halt but only write the wtmp record (in the/var/log/wtmpfile).
- -d
- Don't write the wtmp record. The-nflag implies-d.
- -f
- Force halt or reboot, don't callshutdown(8).
- -i
- Shut down all network interfaces just before halt or reboot.
- -h
- Put all harddrives on the system in standby mode just before halt or poweroff.
- -p
- When halting the system, do a poweroff. This is the default when halt is called aspoweroff.
DIAGNOSTICS
If you're not the superuser, you will get the message `must be superuser'.
NOTES
Under oldersysvinitreleases ,rebootandhaltshould never be called directly. From release 2.74 onhaltandrebootinvokeshutdown(8) if the system is not in runlevel 0 or 6. This means that ifhaltorrebootcannot find out the current runlevel (for example, when/var/run/utmphasn't been initialized correctly)shutdownwill be called, which might not be what you want. Use the-fflag if you want to do a hardhaltorreboot.
The-hflag puts all harddisks in standby mode just before halt or poweroff. Right now this is only implemented for IDE drives. A side effect of putting the drive in standby mode is that the write cache on the disk is flushed. This is important for IDE drives, since the kernel doesn't flush the write-cache itself before poweroff.
Thehaltprogram uses /proc/ide/hd* to find all IDE disk devices, which means that /proc needs to be mounted whenhaltorpoweroffis called or the-hswitch will do nothing.
AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl
SEE ALSO
shutdown(8),init(8)
三 : mkdir 中文man页面(1)
名字
mkdir -建立目录
总览
mkdir [选项]目录...
POSIX 选项:[-p] [-m mode]
GNU 选项(缩写):
[-p] [-m mode] [--verbose] [--help] [--version] [--]mkdir 用指定的名字建立目录。缺省时,新建立的目录模式为0777,即不加保护地对所有人都可读、可写、可执行。
选项
- -m mode, --mode=mode
- 为新建立的目录设定模式,就象应用命令chmod一样,以后仍然使用缺省模式建立新目录。
- -p, --parents
- 为所给出的目录建立丢失了的父目录。所建立的父目录的模式相当于用命令 umask 进行了 'u+wx' 的设置。忽略参数对已存在的目录的覆盖。(例如:已存在目录/a,当用到命令
- --verbose
- 打印出新建立的每一个目录名。与--parents联合使用最有效。
GNU 标准选项
- -help
- 在标准输出上显示使用信息并顺利退出。
- -version
- 在标准输出上显示版本信息并顺利退出
- --
- 终端选项列表.
环境变量
变量LANG,LC_ALL,LC_CTYPE,LC_MESSAGES按常规定义。
遵循
POSIX 1003.2
注意
本文出自 fileutils-4.0,其他版本肯会有微小差别。任何添加或纠错意见请寄:aeb@cwi.nl,程序Bugs请告知: fileutils-bugs@gnu.ai.mit.edu
mkdir 中文man页面(1)_mkdir
NAME
mkdir - make directories
SYNOPSIS
mkdir[OPTION]DIRECTORY...
DESCRIPTION
Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
- -Z,--context=CONTEXT(SELinux) set security context to CONTEXT
- -m,--mode=MODE
- set permission mode (as in chmod), not rwxrwxrwx - umask
- -p,--parents
- no error if existing, make parent directories as needed
- -v,--verbose
- print a message for each created directory
- --help
- display this help and exit
- --version
- output version information and exit
AUTHOR
Written by David MacKenzie.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright © 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
The full documentation formkdiris maintained as a Texinfo manual. If theinfoandmkdirprograms are properly installed at your site, the command
- info coreutils mkdir
should give you access to the complete manual.
四 : diff 中文man页面(1)
名字
diff - 找出两个文件的不同点
总览
diff[选项] 源文件 目标文件
描述
在最简单的情况是,diff比较两个文件的内容(源文件和目标文件). 文件名可以是-由标准输入设备读入的文本. 作为特别的情况是,diff - -比较一份标准输入的它自己的拷贝如果源文件是一个目录和目标文件不是(目录),diff会比较在源文件(目录)里的文件的中和目标文件同名的(文件),反过来也一样. 非目录文件不能是-. 如果源文件和目标文件都是目录,diff比较两个目录中相应的文件,依照字母次序排序;这个比较是不会递归的,除非给出-r或者--recursive.diff不把一个目录的内容看为它是一个文件来比较。被指定的文件不能是标准的输入, 因为标准的输入是无名的并且"有一样的名字的文件"的观点不适用。diff的选项由-, 开始所以正常地源文件(名)和目标文件(名)不可以用-开头. 然而,--可以被它视为保留的即使作为文件名的开头( they begin with-.)
选项
下面是 GNU所接受的diff的所有选项的概要. 大多数的选项有两个相同的名字,一个是单个的跟在-后面字母, 另一个是由--引出的长名字. 多个单字母选项(除非它们产生歧义)能够组合为单行的命令行语法-ac是等同于-a -c. 长命名的选项能被缩短到他们的名字的任何唯一的前缀. 用 ([和]) 括起来显示选项产生歧义的选项
- -行数(一个整数)
- 显示上下文行数(一个整数). 这个选项自身没有指定输出格式,这是没有效果的,除非和-c或者-u组合使用. 这是已废置的选项,对于正确的操作, 上下文至少要有两行。
- -a
- 所有的文件都视为文本文件来逐行比较,甚至他们似乎不是文本文件.
- -b
- 忽略空格引起的变化.
- -B
- 忽略插入删除空行引起的变化.
- --brief
- 仅报告文件是否相异,在乎差别的细节.
- -c
- 使用上下文输出格式.
- -C行数(一个整数)
- --context[=lines]
- 使用上下文输出格式,显示以指定行数(一个整数), 或者是三行(当行数没有给出时. 对于正确的操作, 上下文至少要有两行.
- --changed-group-format=format
- 使用format输出一组包含两个文件的不同处的行,其格式是 if-then-else .
- -d
- 改变算法也许发现变化的一个更小的集合.这会使diff变慢 (有时更慢).
- -Dname
- 合并 if-then-else 格式输出, 预处理宏(由name参数提供)条件.
- -e
- --ed
- 输出为一个有效的ed脚本.
- --exclude=pattern
- 比较目录的时候,忽略和目录中与pattern(样式) 相配的.
- --exclude-from=file
- 比较目录的时候,忽略和目录中与任何包含在file(文件) 的样式相配的文件和目录.
- --expand-tabs
- 在输出时扩展tab为空格,保护输入文件的tab对齐方式
- -f
- 产生一个很象ed脚本的输出,但是但是在他们在文件出现的顺序有改变
- -Fregexp
- 在上下文和统一格式中,对于每一大块的不同,显示出匹配regexp. 的一些前面的行.
- --forward-ed
- 产生象ed脚本的输出,但是它们在文件出现的顺序有改变。
- -h
- 这选项现在已没作用,它呈现Unix的兼容性.
- -H
- 使用启发规则加速操作那些有许多离散的小差异的大文件.
- --horizon-lines=lines
- 比较给定行数的有共同前缀的最后行,和有共同或缀的最前行.
- -i
- 忽略大小写.
- -Iregexp
- 忽略由插入,删除行(由regexp 参数提供参考)带来的改变.
- --ifdef=name
- 合并 if-then-else 格式输出, 预处理宏(由name参数提供)条件.
- --ignore-all-space
- 在比较行的时候忽略空白.
- --ignore-blank-lines
- 忽略插入和删除空行
- --ignore-case
- 忽略大小写.
- --ignore-matching-lines=regexp
- 忽略插入删除行(由regexp 参数提供参考).
- --ignore-space-change
- 忽略空白的数量.
- --initial-tab
- 在文本行(无论是常规的或者格式化的前后文关系)前输出tab代替空格. 引起的原因是tab对齐方式看上去象是常规的一样.
- -l
- 产生通过pr编码的输出.
- -Llabel
- --label=label
- 使用label给出的字符在文件头代替文件名输出.
- --left-column
- 以并列方式印出两公共行的左边
- --line-format=format
- 使用format输出所有的行,在 if-then-else 格式中.
- --minimal
- 改变算法也许发现变化的一个更小的集合.这会使diff变慢 (有时更慢).
- -n
- 输出 RC-格式 diffs; 除了每条指令指定的行数受影响外 象-f一样。
- -N
- --new-file
- 在目录比较中,如果那个文件只在其中的一个目录中找到,那么它被视为在另一个目录中是一个空文件.
- --new-group-format=format
- 使用format以if-then-else 格式输出只在第二个文件中取出的一个行组
- --new-line-format=format
- 使用format以if-then-else 格式输出只在第二个文件中取出的一行
- --old-group-format=format
- 使用format以if-then-else 格式输出只在第一个文件中取出的一个行组
- --old-line-format=format
- 使用format使用format以if-then-else 格式输出只在第一个文件中取出的一行
- -p
- 显示带有c函数的改变.
- -P
- 在目录比较中,如果那个文件只在其中的一个目录中找到,那么它被视为在另一个目录中是一个空文件.
- --paginate
- 产生通过pr编码的输出.
- -q
- 仅报告文件是否相异,不报告详细的差异.
- -r
- 当比较目录时,递归比较任何找到的子目录.
- --rcs
- 输出 RC-格式 diffs; 除了每条指令指定的行数受影响外 象-f一样。
- --recursive
- 当比较目录时,递归比较任何找到的子目录.
- --report-identical-files
- -s
- 报告两个文件相同.
- -Sfile
- 当比较目录时,由file开始. 这用于继续中断了的比较.
- --sdiff-merge-assist
- 打印附加的信息去帮助sdiff.sdiff在运行diff时使用这些选项. 这些选项不是特意为使用者直接使用而准备的。
- --show-c-function
- 显示带有c函数的改变.
- --show-function-line=regexp
- 在上下文和统一的格式,对于每一大块的差别,显示出匹配regexp. 的一些前面的行
- --side-by-side
- 使用并列的输出格式.
- --speed-large-files
- 使用启发规则加速操作那些有许多离散的小差异的大文件.
- --starting-file=file
- 当比较目录时,由file开始. 这用于继续中断了的比较.
- --suppress-common-lines
- 在并列格式中不印出公共行。
- -t
- 在输出时扩展tab为空格,保护输入文件的tab对齐方式
- -T
- 在文本行(无论是常规的或者格式化的前后文关系)前输出tab代替空格.引起的原因是tab对齐方式看上去象是常规的一样.
- --text
- 所有的文件都视为文本文件来逐行比较,甚至他们似乎不是文本文件.
- -u
- 使用统一的输出格式.
- --unchanged-group-format=format
- 使用format输出两个文件的公共行组,其格式是if-then-else.
- --unchanged-line-format=format
- 使用format输出两个文件的公共行,其格式是if-then-else.
- --unidirectional-new-file
- 在目录比较中,如果那个文件只在其中的一个目录中找到,那么它被视为在另一个目录中是一个空文件.
- -Ulines
- --unified[=lines]
- 使用前后关系格式输出,显示以指定行数(一个整数), 或者是三行(当行数没有给出时. 对于正确的操作, 上下文至少要有两行.
- -v
- --version
- 输出diff版本号.
- -w
- 在比较行时忽略空格
- -Wcolumns
- --width=columns
- 在并列格式输出时,使用指定的列宽.
- -xpattern
- 比较目录的时候,忽略和目录中与pattern(样式) 相配的.
- -Xfile
- 比较目录的时候,忽略和目录中与任何包含在file(文件) 的样式相配的文件和目录.
- -y
- 使用并列格式输出
参考
cmp(1), comm(1), diff3(1), ed(1), patch(1), pr(1), sdiff(1).
diff 中文man页面(1)_diff
NAME
diff - find differences between two files
SYNOPSIS
diff[options] from-file to-file
DESCRIPTION
In the simplest case,diffcompares the contents of the two filesfrom-fileandto-file. A file name of-stands for text read from the standard input. As a special case,diff - -compares a copy of standard input to itself.
Iffrom-fileis a directory andto-fileis not,diffcompares the file infrom-filewhose file name is that ofto-file, and vice versa. The non-directory file must not be-.
If bothfrom-fileandto-fileare directories,diffcompares corresponding files in both directories, in alphabetical order; this comparison is not recursive unless the-ror--recursiveoption is given.diffnever compares the actual contents of a directory as if it were a file. The file that is fully specified may not be standard input, because standard input is nameless and the notion of ``file with the same name'' does not apply.
diffoptions begin with-, so normallyfrom-fileandto-filemay not begin with-. However,--as an argument by itself treats the remaining arguments as file names even if they begin with-.
Options
Below is a summary of all of the options that GNUdiffaccepts. Most options have two equivalent names, one of which is a single letter preceded by-, and the other of which is a long name preceded by--. Multiple single letter options (unless they take an argument) can be combined into a single command line word:-acis equivalent to-a -c. Long named options can be abbreviated to any unique prefix of their name. Brackets ([and]) indicate that an option takes an optional argument.
- -lines
- Showlines(an integer) lines of context. This option does not specify an output format by itself; it has no effect unless it is combined with-cor-u. This option is obsolete. For proper operation,patchtypically needs at least two lines of context.
- -a
- Treat all files as text and compare them line-by-line, even if they do not seem to be text.
- -b
- Ignore changes in amount of white space.
- -B
- Ignore changes that just insert or delete blank lines.
- --brief
- Report only whether the files differ, not the details of the differences.
- -c
- Use the context output format.
- -Clines
- --context[=lines]
- Use the context output format, showinglines(an integer) lines of context, or three iflinesis not given. For proper operation,patchtypically needs at least two lines of context.
- --changed-group-format=format
- Useformatto output a line group containing differing lines from both files in if-then-else format.
- -d
- Change the algorithm to perhaps find a smaller set of changes. This makesdiffslower (sometimes much slower).
- -Dname
- Make merged if-then-else format output, conditional on the preprocessor macroname.
- -e
- --ed
- Make output that is a validedscript.
- --exclude=pattern
- When comparing directories, ignore files and subdirectories whose basenames matchpattern.
- --exclude-from=file
- When comparing directories, ignore files and subdirectories whose basenames match any pattern contained infile.
- --expand-tabs
- Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
- -f
- Make output that looks vaguely like anedscript but has changes in the order they appear in the file.
- -Fregexp
- In context and unified format, for each hunk of differences, show some of the last preceding line that matchesregexp.
- --forward-ed
- Make output that looks vaguely like anedscript but has changes in the order they appear in the file.
- -h
- This option currently has no effect; it is present for Unix compatibility.
- -H
- Use heuristics to speed handling of large files that have numerous scattered small changes.
- --horizon-lines=lines
- Do not discard the lastlineslines of the common prefix and the firstlineslines of the common suffix.
- -i
- Ignore changes in case; consider upper- and lower-case letters equivalent.
- -Iregexp
- Ignore changes that just insert or delete lines that matchregexp.
- --ifdef=name
- Make merged if-then-else format output, conditional on the preprocessor macroname.
- --ignore-all-space
- Ignore white space when comparing lines.
- --ignore-blank-lines
- Ignore changes that just insert or delete blank lines.
- --ignore-case
- Ignore changes in case; consider upper- and lower-case to be the same.
- --ignore-matching-lines=regexp
- Ignore changes that just insert or delete lines that matchregexp.
- --ignore-space-change
- Ignore changes in amount of white space.
- --initial-tab
- Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.
- -l
- Pass the output throughprto paginate it.
- -Llabel
- --label=label
- Uselabelinstead of the file name in the context format and unified format headers.
- --left-column
- Print only the left column of two common lines in side by side format.
- --line-format=format
- Useformatto output all input lines in in-then-else format.
- --minimal
- Change the algorithm to perhaps find a smaller set of changes. This makesdiffslower (sometimes much slower).
- -n
- Output RCS-format diffs; like-fexcept that each command specifies the number of lines affected.
- -N
- --new-file
- In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory.
- --new-group-format=format
- Useformatto output a group of lines taken from just the second file in if-then-else format.
- --new-line-format=format
- Useformatto output a line taken from just the second file in if-then-else format.
- --old-group-format=format
- Useformatto output a group of lines taken from just the first file in if-then-else format.
- --old-line-format=format
- Useformatto output a line taken from just the first file in if-then-else format.
- -p
- Show which C function each change is in.
- -P
- When comparing directories, if a file appears only in the second directory of the two, treat it as present but empty in the other.
- --paginate
- Pass the output throughprto paginate it.
- -q
- Report only whether the files differ, not the details of the differences.
- -r
- When comparing directories, recursively compare any subdirectories found.
- --rcs
- Output RCS-format diffs; like-fexcept that each command specifies the number of lines affected.
- --recursive
- When comparing directories, recursively compare any subdirectories found.
- --report-identical-files
- -s
- Report when two files are the same.
- -Sfile
- When comparing directories, start with the filefile. This is used for resuming an aborted comparison.
- --from-file=file
- Comparefileto all operands.filecan be a directory.
- --to-file=file
- Compare all operands tofile.filecan be a directory.
- --sdiff-merge-assist
- Print extra information to helpsdiff.sdiffuses this option when it runsdiff. This option is not intended for users to use directly.
- --show-c-function
- Show which C function each change is in.
- --show-function-line=regexp
- In context and unified format, for each hunk of differences, show some of the last preceding line that matchesregexp.
- --side-by-side
- Use the side by side output format.
- --speed-large-files
- Use heuristics to speed handling of large files that have numerous scattered small changes.
- --starting-file=file
- When comparing directories, start with the filefile. This is used for resuming an aborted comparison.
- --suppress-common-lines
- Do not print common lines in side by side format.
- -t
- Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
- -T
- Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.
- --text
- Treat all files as text and compare them line-by-line, even if they do not appear to be text.
- -u
- Use the unified output format.
- --unchanged-group-format=format
- Useformatto output a group of common lines taken from both files in if-then-else format.
- --unchanged-line-format=format
- Useformatto output a line common to both files in if-then-else format.
- --unidirectional-new-file
- When comparing directories, if a file appears only in the second directory of the two, treat it as present but empty in the other.
- -Ulines
- --unified[=lines]
- Use the unified output format, showinglines(an integer) lines of context, or three iflinesis not given. For proper operation,patchtypically needs at least two lines of context.
- -v
- --version
- Output the version number ofdiff.
- -w
- Ignore white space when comparing lines.
- -Wcolumns
- --width=columns
- Use an output width ofcolumnsin side by side format.
- -xpattern
- When comparing directories, ignore files and subdirectories whose basenames matchpattern.
- -Xfile
- When comparing directories, ignore files and subdirectories whose basenames match any pattern contained infile.
- -y
- Use the side by side output format.
SEE ALSO
cmp(1), comm(1), diff3(1), ed(1), patch(1), pr(1), sdiff(1).
本文标题:
192.168.1.1登录页面-fread 中文man页面(1) 本文地址:
http://www.61k.com/1148823.html