%general-entities; ]> Coreutils-&coreutils-version; Coreutils <para>The Coreutils package contains utilities for showing and setting the basic system characteristics.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem><seg>0.9 SBU</seg><seg>69 MB</seg></seglistitem> </segmentedlist> <segmentedlist> <segtitle>Coreutils installation depends on</segtitle> <seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, Make, Perl, Sed</seg></seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Coreutils Normally the functionality of uname is somewhat broken, in that the -p switch always returns unknown. The following patch fixes this behavior for Intel architectures: patch -Np1 -i ../coreutils-&coreutils-version;-uname-2.patch Prevent Coreutils from installing binaries that will be later be installed by other programs: patch -Np1 -i ../coreutils-&coreutils-version;-suppress_uptime_kill_su-1.patch Now prepare Coreutils for compilation: DEFAULT_POSIX2_VERSION=199209 ./configure --prefix=/usr Compile the package: make The test suite of Coreutils makes several assumptions about the presence of files and users that aren't valid this early in the LFS build. We will therefore have to set up a few things before being able to run the tests. If you choose not to run these tests, skip down to Install the package. Create two dummy groups and a dummy user name: echo "dummy1:x:1000" >> /etc/group echo "dummy2:x:1001:dummy" >> /etc/group echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd Now you're all set to run the test suite. First run the few tests that are meant to be run as root: make NON_ROOT_USERNAME=dummy check-root Then run the remainder of the tests as the dummy user: src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check" When you're done testing, remove the dummy user and groups: sed -i '/dummy/d' /etc/passwd /etc/group Install the package: make install And move some programs to their proper locations: mv /usr/bin/{[,basename,cat,chgrp,chmod,chown,cp,dd,df} /bin mv /usr/bin/{date,echo,false,head,install,ln,ls} /bin mv /usr/bin/{mkdir,mknod,mv,pwd,rm,rmdir,sync} /bin mv /usr/bin/{sleep,stty,test,touch,true,uname} /bin mv /usr/bin/hostname /bin mv /usr/bin/chroot /usr/sbin Finally, create a symlink to be FHS-compliant: ln -s ../../bin/install /usr/bin Contents of Coreutils Installed programs 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, su, sum, sync, tac, tail, tee, test, touch, tr, true, tsort, tty, uname, unexpand, uniq, unlink, uptime, users, vdir, wc, who, whoami and yes Short descriptions basename basename strips any path and a given suffix from the given file name. cat cat concatenates files to standard output. chgrp chgrp changes the group ownership of each given file to the given group. The group can be either given a a name or a numeric ID. chmod chmod changes the permissions of each given 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. chown chown changes the user and/or group ownership of each given file to the given user:group pair. chroot chroot runs a given command with the specified directory as the / directory. The given command can be an interactive shell. On most systems only root can do this. cksum cksum prints the CRC (Cyclic Redundancy Check) checksum and the byte counts of each specified file. comm comm compares two sorted files, outputting in three columns the lines that are unique, and the lines that are common. cp cp copies files. csplit csplit 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. cut cut prints parts of lines, selecting the parts according to given fields or positions. date date displays the current time in the given format, or sets the system date. dd dd copies a file using the given block size and count, while optionally performing conversions on it. df df reports the amount of disk space available (and used) on all mounted file systems, or only on the file systems holding the given files. dir dir is the same as ls. dircolors dircolors outputs commands to set the LS_COLOR environment variable, to change the color scheme used by ls. dirname dirname strips the non-directory suffix from a given file name. du du reports the amount of disk space used by the current directory, or by each of the given directories including all their subdirectories, or by each of the given files. echo echo displays the given strings. env env runs a command in a modified environment. expand expand converts tabs to spaces. expr expr evaluates expressions. factor factor prints the prime factors of all specified integer numbers. false false does nothing, unsuccessfully. It always exits with a status code indicating failure. fmt mt reformats the paragraphs in the given files. fold fold wraps the lines in the given files. groups groups reports a user's group memberships. head head prints the first ten lines (or the given number of lines) of each given file. hostid hostid reports the numeric identifier (in hexadecimal) of the host. hostname hostname reports or sets the name of the host. id id reports the effective user ID, group ID, and group memberships of the current user, or of a given user. install install copies files while setting their permission modes and, if possible, their owner and group. join join joins from two files the lines that have identical join fields. link link creates a hard link with the given name to the given file. ln ln makes hard links or soft links between files. logname logname reports the current user's login name. ls ls lists the contents of each given directory. By default it orders the files and subdirectories alphabetically. md5sum md5sum reports or checks MD5 (Message Digest 5) checksums. mkdir mkdir creates directories with the given names. mkfifo mkfifo creates FIFOs (First-In, First-Out, a named pipe in UNIX parlance) with the given names. mknod mknod creates device nodes with the given names. A device node is a character special file, or a block special file, or a FIFO. mv mv moves or renames files or directories. nice nice runs a program with modified scheduling priority. nl nl numbers the lines from the given files. nohup nohup runs a command immune to hangups, with output redirected to a log file. od od dumps files in octal and other formats. paste paste merges the given files, joining sequentially corresponding lines side by side, separated by tab characters.. pathchk pathchk checks whether file names are valid or portable. pinky pinky is a lightweight finger. It reports some information about the given users. pr pr paginates and columnates files for printing. printenv printenv prints the environment. printf printf prints the given arguments according to the given format -- much like the C printf function. ptx ptx produces from the contents of the given files a permuted index, with each keyword in its context. pwd pwd reports the name of the current directory. readlink readlink reports the value of the given symbolic link. rm rm removes files or directories. rmdir rmdir removes directories, if they are empty. seq seq prints a sequence of numbers, within a given range and with a given increment. sha1sum sha1sum prints or checks 160-bit SHA1 checksums. shred shred overwrites the given files repeatedly with strange patterns, to make it real hard to recover the data. sleep sleep pauses for the given amount of time. sort sort sorts the lines from the given files. split split splits the given file into pieces, by size or by numbspliter of lines. stty stty sets or reports terminal line settings. su su runs a shell with substitute user and group IDs. sum sum prints checksum and block counts for each given file. sync sync flushes file system buffers. It forces changed blocks to disk and updates the super block. tac tac concatenates the given files in reverse. tail tail prints the last ten lines (or the given number of lines) of each given file. tee tee reads from standard input while writing both to standard output and to the given files. test test compares values and checks file types. touch touch changes file timestamps, setting the access and modification times of the given files to the current time. Files that do not exist are created with zero length. tr tr translates, squeezes, and deletes the given characters from standard input. true true does nothing, successfully. It always exits with a status code indicating success. tsort tsort performs a topological sort. It writes a totally ordered list according to the partial ordering in a given file. tty tty reports the file name of the terminal connected to standard input. uname uname reports system information. unexpand unexpand converts spaces to tabs. uniq uniq discards all but one of successive identical lines. unlink unlink removes the given file. uptime uptime reports how long the system has been running, how many users are logged on, and the system load averages. users users reports the names of the users currently logged on. vdir vdir is the same as ls -l. wc wc reports the number of lines, words, and bytes for each given file, and a total line when more than one file is given. who who reports who is logged on. whoami whoami reports the user name associated with the current effective user ID. yes yes outputs y or a given string repeatedly, until killed.