📄 coreutils.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content= "application/xhtml+xml; charset=iso-8859-1" /> <title> 10.10. Coreutils-5.94 </title> <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /> <link rel="stylesheet" href="../stylesheets/lfs-print.css" type= "text/css" media="print" /> </head> <body id="lfs" class="CLFS-SVN-20060417-MIPS"> <div class="navheader"> <div class="headertitles"> <h4> Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS </h4> <h3> Chapter 10. Installing Basic System Software </h3> </div> <ul class="headerlinks"> <li class="prev"> <a accesskey="p" href="gcc.html" title="GCC-4.1.0">Prev</a> <p> GCC-4.1.0 </p> </li> <li class="next"> <a accesskey="n" href="zlib.html" title="Zlib-1.2.3">Next</a> <p> Zlib-1.2.3 </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 10. Installing Basic System Software">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS"> Home</a> </li> </ul> </div> <div class="wrap" lang="en" xml:lang="en"> <div class="titlepage"> <h1 class="sect1"> 10.10. Coreutils-5.94 </h1> </div> <div class="package" lang="en" xml:lang="en"> <p> The Coreutils package contains utilities for showing and setting the basic system characteristics. </p> <div class="segmentedlist"> <div class="seglistitem"> <div class="seg"> <strong><span class="segtitle">Installation depends on:</span></strong> <span class="seg">Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, Make, Patch, Perl, and Sed</span> </div> </div> </div> </div> <div class="installation" lang="en" xml:lang="en"> <div class="titlepage"> <h2 class="sect2"> 10.10.1. Installation of Coreutils </h2> </div> <p> Prevent Coreutils from installing binaries that will be installed by other packages: </p> <pre class="userinput"><kbd class="command">patch -Np1 -i ../coreutils-5.94-suppress_uptime_kill_su-2.patch</kbd></pre> <p> Now prepare Coreutils for compilation: </p> <pre class="userinput"><kbd class="command">./configure --prefix=/usr</kbd></pre> <p> Compile the package: </p> <pre class="userinput"><kbd class="command">make</kbd></pre> <p> The test suite of Coreutils makes several assumptions about the presence of system users and groups that are not valid within the minimal environment that exists at the moment. Therefore, additional items need to be set up before running the tests. Skip down to “<span class="quote">Install the package</span>” if not running the test suite. </p> <p> Create two <tt class="systemitem">dummy</tt> groups and a <tt class="systemitem">dummy</tt> user: </p> <pre class="userinput"><kbd class="command">echo "dummy1:x:1000:" >> /etc/groupecho "dummy2:x:1001:dummy" >> /etc/groupecho "dummy:x:1000:1000::/root:/bin/bash" >> /etc/passwd</kbd></pre> <p> Now the test suite is ready to be run. First, run the tests that are meant to be run as user <tt class="systemitem">root</tt>: </p> <pre class="userinput"><kbd class="command">make NON_ROOT_USERNAME=dummy check-root</kbd></pre> <p> Then run the remainder of the tests as the <tt class= "systemitem">dummy</tt> user: </p> <pre class="userinput"><kbd class="command">src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</kbd></pre> <p> When testing is complete, remove the <tt class= "systemitem">dummy</tt> user and groups: </p> <pre class="userinput"><kbd class="command">sed -i '/dummy/d' /etc/passwd /etc/group</kbd></pre> <p> Install the package: </p> <pre class="userinput"><kbd class="command">make install</kbd></pre> <p> Move programs to the locations specified by the FHS: </p> <pre class="userinput"><kbd class="command">mv -v /usr/bin/{[,basename,cat,chgrp,chmod,chown,cp} /binmv -v /usr/bin/{date,dd,df,echo,false,hostname,install,ln} /binmv -v /usr/bin/{ls,mkdir,mknod,mv,nice,pwd,readlink,rm,rmdir,sync} /binmv -v /usr/bin/{stty,test,touch,true,uname} /binmv -v /usr/bin/chroot /usr/sbinln -svf ../../bin/install /usr/bin</kbd></pre> <p> Some of the scripts in the LFS-Bootscripts package depend on <span><strong class="command">head</strong></span> and <span><strong class="command">sleep</strong></span>. As <tt class= "filename">/usr</tt> may not be available during the early stages of booting, those binaries need to be on the root partition: </p> <pre class="userinput"><kbd class="command">mv -v /usr/bin/{head,sleep} /bin</kbd></pre> </div> <div class="content" lang="en" xml:lang="en"> <div class="titlepage"> <a id="contents-coreutils" name="contents-coreutils"></a> <h2 class="sect2"> 10.10.2. Contents of Coreutils </h2> </div> <div class="segmentedlist"> <div class="seglistitem"> <div class="seg"> <strong><span class="segtitle">Installed programs:</span></strong> <span class="seg">basename, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups, head, hostid, hostname, id, install, join, link, ln, logname, ls, md5sum, mkdir, mkfifo, mknod, mv, nice, nl, nohup, od, paste, pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, rm, rmdir, seq, sha1sum, shred, sleep, sort, split, stat, stty, sum, sync, tac, tail, tee, test, touch, tr, true, tsort, tty, uname, unexpand, uniq, unlink, users, vdir, wc, who, whoami, and yes</span> </div> </div> </div> <div class="variablelist"> <h3> <a id="id3666066" name="id3666066"></a>Short Descriptions </h3> <table border="0"> <col align="left" valign="top" /> <tbody> <tr> <td> <a id="basename" name="basename"></a><span class= "term"><span><strong class= "command">basename</strong></span></span> </td> <td> <p> Strips any path and a given suffix from a file name </p> </td> </tr> <tr> <td> <a id="cat" name="cat"></a><span class= "term"><span><strong class= "command">cat</strong></span></span> </td> <td> <p> Concatenates files to standard output </p> </td> </tr> <tr> <td> <a id="chgrp" name="chgrp"></a><span class= "term"><span><strong class= "command">chgrp</strong></span></span> </td> <td> <p> Changes the group ownership of files and directories </p> </td> </tr> <tr> <td> <a id="chmod" name="chmod"></a><span class= "term"><span><strong class= "command">chmod</strong></span></span> </td> <td> <p> Changes the permissions of each file to the given mode; the mode can be either a symbolic representation of the changes to make or an octal number representing the new permissions </p> </td> </tr> <tr> <td> <a id="chown" name="chown"></a><span class= "term"><span><strong class= "command">chown</strong></span></span> </td> <td> <p> Changes the user and/or group ownership of files and directories </p> </td> </tr> <tr> <td> <a id="chroot" name="chroot"></a><span class= "term"><span><strong class= "command">chroot</strong></span></span> </td> <td> <p> Runs a command with the specified directory as the <tt class="filename">/</tt> directory </p> </td> </tr> <tr> <td> <a id="cksum" name="cksum"></a><span class= "term"><span><strong class= "command">cksum</strong></span></span> </td> <td> <p> Prints the Cyclic Redundancy Check (CRC) checksum and the byte counts of each specified file </p> </td> </tr> <tr> <td> <a id="comm" name="comm"></a><span class= "term"><span><strong class= "command">comm</strong></span></span> </td> <td> <p> Compares two sorted files, outputting in three columns the lines that are unique and the lines that are common </p> </td> </tr> <tr> <td> <a id="cp" name="cp"></a><span class= "term"><span><strong class= "command">cp</strong></span></span> </td> <td> <p> Copies files </p> </td> </tr> <tr> <td> <a id="csplit" name="csplit"></a><span class= "term"><span><strong class= "command">csplit</strong></span></span> </td> <td> <p> Splits a given file into several new files, separating them according to given patterns or line numbers and outputting the byte count of each new file </p> </td> </tr> <tr> <td> <a id="cut" name="cut"></a><span class= "term"><span><strong class= "command">cut</strong></span></span> </td> <td> <p> Prints sections of lines, selecting the parts according to given fields or positions </p> </td> </tr> <tr> <td> <a id="date" name="date"></a><span class= "term"><span><strong class= "command">date</strong></span></span> </td> <td> <p> Displays the current time in the given format, or sets the system date </p> </td> </tr> <tr> <td> <a id="dd" name="dd"></a><span class= "term"><span><strong class= "command">dd</strong></span></span> </td> <td> <p> Copies a file using the given block size and count, while optionally performing conversions on it </p> </td> </tr> <tr> <td> <a id="df" name="df"></a><span class= "term"><span><strong class= "command">df</strong></span></span> </td> <td> <p> Reports the amount of disk space available (and used) on all mounted file systems, or only on the file systems holding the selected files </p> </td> </tr> <tr> <td> <a id="dir" name="dir"></a><span class= "term"><span><strong class= "command">dir</strong></span></span> </td> <td> <p> Lists the contents of each given directory (the same as the <span><strong class="command">ls</strong></span> command) </p> </td> </tr> <tr> <td> <a id="dircolors" name="dircolors"></a><span class= "term"><span><strong class= "command">dircolors</strong></span></span> </td> <td> <p> Outputs commands to set the <tt class= "envar">LS_COLOR</tt> environment variable to change the color scheme used by <span><strong class= "command">ls</strong></span> </p> </td> </tr> <tr> <td> <a id="dirname" name="dirname"></a><span class= "term"><span><strong class= "command">dirname</strong></span></span> </td> <td> <p> Strips the non-directory suffix from a file name </p> </td> </tr> <tr> <td> <a id="du" name="du"></a><span class= "term"><span><strong class= "command">du</strong></span></span> </td> <td> <p> Reports the amount of disk space used by the current directory, by each of the given directories (including all subdirectories) or by each of the given files </p> </td> </tr> <tr> <td> <a id="echo" name="echo"></a><span class= "term"><span><strong class= "command">echo</strong></span></span> </td> <td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -