⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utils.sgml

📁 cygwin, 著名的在win32下模拟unix操作系统的东东
💻 SGML
📖 第 1 页 / 共 4 页
字号:
SIGALRM     14    alarm clockSIGTERM     15    software termination signal from killSIGURG      16    urgent condition on IO channelSIGSTOP     17    sendable stop signal not from ttySIGTSTP     18    stop signal from ttySIGCONT     19    continue a stopped processSIGCHLD     20    to parent on child stop or exitSIGTTIN     21    to readers pgrp upon background tty readSIGTTOU     22    like TTIN for output if (tp-&gt;t_local&amp;LTOSTOP)SIGPOLL     23    System V name for SIGIOSIGXCPU     24    exceeded CPU time limitSIGXFSZ     25    exceeded file size limitSIGVTALRM   26    virtual time alarmSIGPROF     27    profiling time alarmSIGWINCH    28    window changedSIGLOST     29    resource lost (eg, record-lock lost)SIGUSR1     30    user defined signal 1SIGUSR2     31    user defined signal 2</screen></sect2><sect2 id="mkgroup"><title>mkgroup</title><screen>Usage: mkgroup [OPTION]... [domain]This program prints a /etc/group file to stdoutOptions:   -l,--local             print local group information   -d,--domain            print global group information from the domain                          specified (or from the current domain if there is                          no domain specified)   -o,--id-offset offset  change the default offset (10000) added to uids                          in domain accounts.   -s,--no-sids           don't print SIDs in pwd field                          (this affects ntsec)   -u,--users             print user list in gr_mem field   -h,--help              print this message   -v,--version           print version information and exitOne of `-l' or `-d' must be given on NT/W2K.</screen><para>The <command>mkgroup</command> program can be used to helpconfigure your Windows system to be more UNIX-like by creating aninitial <filename>/etc/group</filename> substitute (some commands need thisfile) from your system information. It only works on the NT series(Windows NT, 2000, and XP). <command>mkgroup</command> does not work on the Win9x series (Windows 95, 98, and Me) because they lack the security model to support it. To initially set up your machine, you'd do something like this:</para><example><title>Setting up the groups file</title><screen><prompt>$</prompt> <userinput>mkdir /etc</userinput><prompt>$</prompt> <userinput>mkgroup -l &gt; /etc/group</userinput></screen></example><para>Note that this information is static.  If you change the groupinformation in your system, you'll need to regenerate the group filefor it to have the new information.</para><para>The <literal>-d</literal> and <literal>-l</literal> optionsallow you to specify where the information comes from, either thelocal machine or the default (or given) domain.  The <literal>-o</literal>option allows for special cases (such as multiple domains) where the GIDs might match otherwise. The <literal>-s</literal>option omits the NT Security Identifier (SID).  For more information on SIDs, see <Xref Linkend="ntsec"> in the Cygwin User's Guide.  The<literal>-u</literal> option causes <command>mkgroup</command> to enumerate the users for each group, placing the group members in the gr_mem (last) field.  Note that this can greatly increasethe time for <command>mkgroup</command> to run in a large domain.</para></sect2><sect2 id="mkpasswd"><title>mkpasswd</title><screen>Usage: mkpasswd [OPTION]... [domain]This program prints a /etc/passwd file to stdoutOptions:   -l,--local              print local user accounts   -d,--domain             print domain accounts (from current domain                           if no domain specified)   -o,--id-offset offset   change the default offset (10000) added to uids                           in domain accounts.   -g,--local-groups       print local group information too                           if no domain specified   -m,--no-mount           don't use mount points for home dir   -s,--no-sids            don't print SIDs in GCOS field                           (this affects ntsec)   -p,--path-to-home path  use specified path instead of user account home dir   -u,--username username  only return information for the specified user   -h,--help               displays this message   -v,--version            version information and exitOne of `-l', `-d' or `-g' must be given on NT/W2K.</screen><para>The <command>mkpasswd</command> program can be used to helpconfigure your Windows system to be more UNIX-like by creating aninitial <filename>/etc/passwd</filename> substitute (some commandsneed this file) from your system information. It only works on the NT series(Windows NT, 2000, and XP). <command>mkpasswd</command> does not work on the Win9x series (Windows 95, 98, and Me) because they lack the security model to support it. To initially set up your machine, you'd do something like this:</para><example><title>Setting up the passwd file</title><screen><prompt>$</prompt> <userinput>mkdir /etc</userinput><prompt>$</prompt> <userinput>mkpasswd -l &gt; /etc/passwd</userinput></screen></example><para>Note that this information is static.  If you change the userinformation in your system, you'll need to regenerate the passwd filefor it to have the new information.</para><para>The <literal>-d</literal> and <literal>-l</literal> optionsallow you to specify where the information comes from, either thelocal machine or the default (or given) domain.  The <literal>-o</literal>option allows for special cases (such as multiple domains) where the UIDsmight match otherwise.  The <literal>-g</literal> option creates a localuser that corresponds to each local group. This is because NT assigns groupsfile ownership.  The <literal>-m</literal> option bypasses the currentmount table so that, for example, two users who have a Windows home directory of H: could mount them differently.  The <literal>-s</literal>option omits the NT Security Identifier (SID).  For more information onSIDs, see <Xref Linkend="ntsec"> in the Cygwin User's Guide.  The<literal>-p</literal> option causes <command>mkpasswd</command> touse a prefix other than <literal>/home/</literal>. For example, this command:<example><title>Using an alternate home root</title><screen><prompt>$</prompt> <userinput>mkpasswd -l -p "$(cygpath -H)" &gt; /etc/passwd</userinput></screen></example>would put local users' home directories in the Windows 'Profiles' directory. The <literal>-u</literal> option allows <command>mkpasswd</command> to search for a specific username, greatly reducing the amount of time it takes in a large domain.</para></sect2><sect2 id="mount"><title>mount</title><screen>Usage: mount [OPTION] [&lt;win32path&gt; &lt;posixpath&gt;]  -b, --binary                  text files are equivalent to binary files                                (newline = \n)  -c, --change-cygdrive-prefix  change the cygdrive path prefix to &lt;posixpath&gt;  -f, --force                   force mount, don't warn about missing mount                                point directories  -h, --help                    output usage information and exit  -m, --mount-commands          write mount commands to replace user and                                system mount points and cygdrive prefixes  -p, --show-cygdrive-prefix    show user and/or system cygdrive path prefix  -s, --system     (default)    add system-wide mount point  -t, --text       (default)    text files get \r\n line endings  -u, --user                    add user-only mount point  -v, --version                 output version information and exit  -x, --executable              treat all files under mount point as executables  -E, --no-executable           treat all files under mount point as                                 non-executables  -X, --cygwin-executable       treat all files under mount point as cygwin                                executables</screen><para>The <command>mount</command> program is used to map your drivesand shares onto Cygwin's simulated POSIX directory tree, much like as isdone by mount commands on typical UNIX systems.  Please see<Xref Linkend="mount-table"> for more information on the conceptsbehind the Cygwin POSIX file system and strategies for usingmounts. To remove mounts, use <command>umount</command></para><sect3><title>Using mount</title><para>If you just type <command>mount</command> with no parameters, itwill display the current mount table for you.</para><example><title>Displaying the current set of mount points</title><screen><prompt>c:\cygwin\&gt;</prompt> <userinput>mount</userinput>c:\cygwin\bin on /usr/bin type system (binmode)c:\cygwin\lib on /usr/lib type system (binmode)c:\cygwin on / type system (binmode)c: on /c type user (binmode,noumount)d: on /d type user (binmode,noumount)</screen></example><para>In this example, c:\cygwin is the POSIX root and D drive is mapped to<filename>/d</filename>.  Note that in this case, the root mount is asystem-wide mount point that is visible to all users running Cygwinprograms, whereas the <filename>/d</filename> mount is only visibleto the current user.</para><para>The <command>mount</command> utility is also the mechanism foradding new mounts to the mount table.  The following exampledemonstrates how to mount the directory<filename>\\pollux\home\joe\data</filename> to <filename>/data</filename>.</para><example><title>Adding mount points</title><screen><prompt>c:\cygwin\&gt;</prompt> <userinput>ls /data</userinput>ls: /data: No such file or directory<prompt>c:\cygwin\&gt;</prompt> <userinput>mount \\pollux\home\joe\data /data</userinput>mount: warning - /data does not exist!<prompt>c:\cygwin\&gt;</prompt> <userinput>mount</userinput>\\pollux\home\joe\data on /data type sytem (binmode)c:\cygwin\bin on /usr/bin type system (binmode)c:\cygwin\lib on /usr/lib type system (binmode)c:\cygwin on / type system (binmode)c: on /c type user (binmode,noumount)d: on /d type user (binmode,noumount)</screen></example><para>Note that <command>mount</command> was invoked from the Windowscommand shell in the previous example.  In many Unix shells, includingbash, it is legal and convenient to use the forward "/" in Win32pathnames since the "\" is the shell's escape character. </para><para>The <literal>-s</literal> flag to <command>mount</command> is used to add a mountin the system-wide mount table used by all Cygwin users on the system,instead of the user-specific one.  System-wide mounts are displayedby <command>mount</command> as being of the "system" type, as is thecase for the <filename>/</filename> partition in the last example.Under Windows NT, only those users with Administrator priviledges arepermitted to modify the system-wide mount table.</para><para>Note that a given POSIX path may only exist once in the usertable and once in the global, system-wide table.  Attempts to replacethe mount will fail with a busy error.  The <literal>-f</literal> (force) flag causesthe old mount to be silently replaced with the new one.  It will alsosilence warnings about the non-existence of directories at the Win32path location.</para><para>The <literal>-b</literal> flag is used to instruct Cygwin to treat binary andtext files in the same manner by default.  Binary mode mounts aremarked as "binmode" in the Flags column of <command>mount</command>output.  By default, mounts are in text mode ("textmode" in the Flagscolumn).</para><para>Normally, files ending in certain extensions (.exe, .com, .bat, .cmd) are assumed to be executable.  Files whose first two characters begin with '#!' are also considered to be executable.  The <literal>-x</literal> flag is used to instruct Cygwin that the mounted file is "executable".  If the <literal>-x</literal> flag is used with a directory then all files in the directory are executable.  This option allows other files to be marked as executable and avoids the overhead of opening each file to check for a '#!'.  The <literal>-X</literal>option is very similar to <literal>-x</literal>, but also prevents Cygwinfrom setting up commands and environment variables for a normal Windows program, adding another small performance gain.  The opposite of these flags is the <literal>-E</literal> flag, which means that no files should be marked as executable.  </para><para>The <literal>-m</literal> option causes the <command>mount</command> utilityto output a series of commands that could recreate both user and system mount points. You can save this output as a backup when experimenting with themount table. It also makes moving your settings to a different machinemuch easier.</para></sect3><sect3><title>Cygdrive mount points</title><para>Whenever Cygwin cannot use any of the existing mounts to convertfrom a particular Win32 path to a POSIX one, Cygwin will, instead,convert to a POSIX path using a default mount point:<filename>/cygdrive</filename>.  For example, if Cygwin accesses<filename>z:\foo</filename> and the z drive is not currently in themount table, then <filename>z:\</filename> will be accessible as<filename>/cygdrive/z</filename>.  The <command>mount</command> utility can be used to change this default automount prefix through the use of the"--change-cygdrive-prefix" option.  In the following example, we willset the automount prefix to <filename>/</filename>:</para><example><title>Changing the default prefix</title><screen><prompt>c:\cygwin\&gt;</prompt> <userinput>mount --change-cygdrive-prefix /</userinput></screen></example><para>Note that you if you set a new prefix in this manner, you canspecify the <literal>-s</literal> flag to make this the system-wide default prefix.  By default, the cygdrive-prefix applies only to the current user.  You can always see the user and system cygdrive prefixes with the <literal>-p</literal> option.  Using the <literal>-b</literal>flag with <literal>--change-cygdrive-prefix</literal> makes all new automounted filesystems default to binary mode file accesses.</para></sect3><sect3><title>Limitations</title><para>Limitations: there is a hard-coded limit of 30 mountpoints.  Also, although you can mount to pathnames that do not startwith "/", there is no way to make use of such mount points.</para><para>Normally the POSIX mount point in Cygwin is an existing emptydirectory, as in standard UNIX. If this is the case, or if there is aplace-holder for the mount point (such as a file, a symbolic linkpointing anywhere, or a non-empty directory), you will get the expectedbehavior. Files present in a mount point directory before the mountbecome invisible to Cygwin programs.</para><para>It is sometimes desirable to mount to a non-existent directory,for example to avoid cluttering the root directory with namessuch as<filename>a</filename>, <filename>b</filename>, <filename>c</filename>pointing to disks.Although <command>mount</command> will give you a warning, mosteverything will work properly when you refer to the mount pointexplicitly.  Some strange effects can occur however.For example if your current working directory is<filename>/dir</filename>,say, and <filename>/dir/mtpt</filename> is a mount point, then<filename>mtpt</filename> will not show up in an <command>ls</command>or<command>echo *</command> command and <command>find .</command> willnotfind <filename>mtpt</filename>.</para>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -