注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Package:Coreutils"

From Funtoo
Jump to navigation Jump to search
(Changed the format from a bulleted list to a table with the name of the binaries and a description of their function.)
(added all the remaining coreutils, with descriptions for most, common usages for some. Listed symlinks and note about other distro paths.)
 
(4 intermediate revisions by 2 users not shown)
Line 4: Line 4:
|Homepage=http://www.gnu.org/software/coreutils/
|Homepage=http://www.gnu.org/software/coreutils/
}}
}}
The core utils package provides many essential linux binaries:
The core utils package provides many essential Linux binaries:
(Note that in some other distros, all these binaries exist in /usr/bin and /bin itself is a symlink to /usr/bin)


{{TableStart}}
{{TableStart}}
<tr class="info"><th>Binary name</th><th>Binary function</th></tr>
<tr class="info"><th>Binary name</th><th>Binary function</th><th>Common Usage</th></tr>
<tr><td>/bin/basename</td><td>Remove leading directory components from a given directory listing.</td></tr>
<tr><td>[[Package:Coreutils/basename | /bin/basename]]</td><td>Remove leading directory components from a given directory listing.</td><td></td></tr>
<tr><td>/bin/cat</td><td>TODO</td></tr>
<tr><td>/bin/cat</td><td>Used to concatenate files and print them to stdout.</td><<td>cat file1 file2...<br/>cat file</td></tr>
<tr><td>/bin/chgrp</td><td>TODO</td></tr>
<tr><td>/bin/chgrp</td><td>Used to change group ownership</td><td>chgroup group /path/filename</td></tr>
<tr><td>/bin/chmod</td><td>TODO</td></tr>
<tr><td>/bin/chmod</td><td>change file mode bits</td><td></td></tr>
<tr><td>/bin/chown</td><td>TODO</td></tr>
<tr><td>/bin/chown</td><td>Change file ownership and group membership</td><td>chown user:group filename<br/> chown -R user:group dirname</td></tr>
<tr><td>[[Package:Coreutils/chroot | /bin/chroot]]</td><td>TODO</td></tr>
<tr><td>[[Package:Coreutils/chroot | /bin/chroot]]</td><td>Temporarily changes the current root to the specified path</td><td>chroot /newrootpath/</td></tr>
<tr><td>/bin/cp</td><td>TODO</td></tr>
<tr><td>/bin/cp</td><td>copy files and directories</td><td>cp /path/file1 /path/file2</td></tr>
<tr><td>/bin/cut</td><td>TODO</td></tr>
<tr><td>/bin/cut</td><td>remove sections from each line of files</td><td></td></tr>
<tr><td>/bin/date</td><td>TODO</td></tr>
<tr><td>/bin/date</td><td>print or set the system date and time</td><td></td></tr>
<tr><td>/bin/dd</td><td>TODO</td></tr>
<tr><td>/bin/dd</td><td>convert and copy a file</td><td></td></tr>
<tr><td>/bin/df</td><td>TODO</td></tr>
<tr><td>/bin/df</td><td>report file system space usage</td><td>df -h mountpoint</td></tr>
<tr><td>/bin/dir</td><td>TODO</td></tr>
<tr><td>/bin/dir</td><td>strip last component from file name</td><td></td></tr>
<tr><td>/bin/dirname</td><td>TODO</td></tr>
<tr><td>/bin/dirname</td><td>strip last component from file name</td><td></td></tr>
<tr><td>/bin/du</td><td>TODO</td></tr>
<tr><td>/bin/du</td><td>estimate file space usage</td><td>du /path/<br/>du -h /path/</td></tr>
<tr><td>/bin/echo</td><td>TODO</td></tr>
<tr><td>/bin/echo</td><td>display a line of text</td><td>echo "hello world"</td></tr>
<tr><td>/bin/env</td><td>TODO</td></tr>
<tr><td>/bin/env</td><td>run a program in a modified environment</td><td></td></tr>
<tr><td>/bin/expr</td><td>TODO</td></tr>
<tr><td>/bin/expr</td><td>evaluate expressions</td><td></td></tr>
<tr><td>/bin/false</td><td>TODO</td></tr>
<tr><td>/bin/false</td><td>do nothing, unsuccessfully</td><td></td></tr>
<tr><td>/bin/head</td><td>TODO</td></tr>
<tr><td>/bin/head</td><td>output the first part of files</td><td></td></tr>
<tr><td>/bin/ln</td><td>TODO</td></tr>
<tr><td>/bin/ln</td><td>Create hard and symbolic links between different files.</td><td></td></tr>
<tr><td>/bin/ls</td><td>TODO</td></tr>
<tr><td>/bin/ls</td><td>List files and directories on the filesystem</td><td>ls -alh /home/username/</td></tr>
<tr><td>/bin/mkdir</td><td>TODO</td></tr>
<tr><td>/bin/mkdir</td><td>Create a new, empty directory</td><td>mkdir /path/dirname<br/>mkdir -p /path/all/these/dirs/are/new</td></tr>
<tr><td>/bin/mkfifo</td><td>TODO</td></tr>
<tr><td>/bin/mkfifo</td><td>make FIFOs (named pipes)</td><td></td></tr>
<tr><td>/bin/mknod</td><td>TODO</td></tr>
<tr><td>/bin/mknod</td><td>make block or character special files</td><td></td></tr>
<tr><td>/bin/mktemp</td><td>TODO</td></tr>
<tr><td>/bin/mktemp</td><td>create a temporary file or directory</td><td></td></tr>
<tr><td>/bin/mv</td><td>TODO</td></tr>
<tr><td>/bin/mv</td><td>Move a file to a different location on the filesystem.</td><td></td></tr>
<tr><td>/bin/pwd</td><td>TODO</td></tr>
<tr><td>/bin/pwd</td><td>Output the Present Working Directory.</td><td>mv /path/oldfile /newpath/newfile</td></tr>
<tr><td>/bin/readlink</td><td>TODO</td></tr>
<tr><td>/bin/readlink</td><td>print resolved symbolic links or canonical file names</td><td></td></tr>
<tr><td>/bin/rm</td><td>TODO</td></tr>
<tr><td>/bin/rm</td><td>Remove a file, directory, etc. from the filesystem.</td><td>rm /path/filename</td></tr>
<tr><td>/bin/rmdir</td><td>TODO</td></tr>
<tr><td>/bin/rmdir</td><td>Remove a directory from the filesystem.</td><td>rmdir /path/dirname</td></tr>
<tr><td>/bin/seq</td><td>TODO</td></tr>
<tr><td>/bin/seq</td><td>print a sequence of numbers</td><td></td></tr>
<tr><td>/bin/sleep</td><td>TODO</td></tr>
<tr><td>/bin/sleep</td><td>delay for a specified amount of time</td><td>sleep 10</td></tr>
<tr><td>/bin/sort</td><td>TODO</td></tr>
<tr><td>/bin/sort</td><td>sort lines of text files</td><td></td></tr>
<tr><td>/bin/stty</td><td>TODO</td></tr>
<tr><td>/bin/stty</td><td>change and print terminal line settings</td><td></td></tr>
<tr><td>/bin/sync</td><td>TODO</td></tr>
<tr><td>/bin/sync</td><td>Synchronize cached writes to persistent storage</td><td></td></tr>
<tr><td>/bin/tail</td><td>TODO</td></tr>
<tr><td>/bin/tail</td><td>output the last part of files</td><td>tail /var/log/messages</td></tr>
<tr><td>/bin/touch</td><td>TODO</td></tr>
<tr><td>/bin/touch</td><td>Create an empty file on the filesystem.</td><td>touch /path/filename</td></tr>
<tr><td>/bin/tr</td><td>TODO</td></tr>
<tr><td>/bin/tr</td><td>translate or delete characters</td><td></td></tr>
<tr><td>/bin/true</td><td>TODO</td></tr>
<tr><td>/bin/true</td><td>do nothing, successfully</td><td></td></tr>
<tr><td>/bin/tty</td><td>TODO</td></tr>
<tr><td>/bin/tty</td><td>print the file name of the terminal connected to standard input</td><td></td></tr>
<tr><td>/bin/uname</td><td>TODO</td></tr>
<tr><td>/bin/uname</td><td>print system information</td><td>uname -a</td></tr>
<tr><td>/bin/vdir</td><td>TODO</td></tr>
<tr><td>/bin/vdir</td><td>list directory contents</td><td></td></tr>
<tr><td>/bin/wc</td><td>TODO</td></tr>
<tr><td>/bin/wc</td><td>print newline, word, and byte counts for each file</td><td></td></tr>
<tr><td>/bin/yes</td><td>TODO</td></tr>
<tr><td>/bin/yes</td><td>output a string repeatedly until killed</td><td></td></tr>
<tr><td>/usr/bin/[</td><td>tests the subsequent expression for truth</td><td></td></tr>
<tr><td>/usr/bin/arch</td><td>prints the machine architecture, alias for /bin/uname -m</td><td></td></tr>
<tr><td>/usr/bin/b2sum</td><td>calculates the BLAKE2 checksum of the input</td><td></td></tr>
<tr><td>/usr/bin/base32</td><td>Base32 encodes/decodes the given file or input</td><td></td></tr>
<tr><td>/usr/bin/base64</td><td>Base64 encodes/decodes the given file or input</td><td></td></tr>
<tr><td>/usr/bin/basenc</td><td>encodes/decodes the given file or input using the specific encoding</td><td></td></tr>
<tr><td>/usr/bin/chcon</td><td>change the SELINUX security context of the given file</td><td></td></tr>
<tr><td>/usr/bin/cksum</td><td>calculates the checksum of the given file using the specified algorithm</td><td></td></tr>
<tr><td>/usr/bin/comm</td><td>compare two sorted files line by line</td><td></td></tr>
<tr><td>/usr/bin/csplit</td><td>use patterns to split a file's content</td><td></td></tr>
<tr><td>/usr/bin/dircolors</td><td>outputs commands to set colours used in ls output</td><td></td></tr>
<tr><td>/usr/bin/expand</td><td>converts tab characters to blocks of multiple space characters</td><td></td></tr>
<tr><td>/usr/bin/factor</td><td>Print the prime factors of the specified integer number</td><td></td></tr>
<tr><td>/usr/bin/fmt</td><td>Simple text paragraph formatter</td><td></td></tr>
<tr><td>/usr/bin/fold</td><td>Wraps long lines in given file to specified width</td><td></td></tr>
<tr><td>/usr/bin/hostid</td><td>Prints the numeric(hexdecimal) ID of the current machine</td><td></td></tr>
<tr><td>/usr/bin/id</td><td>Prints the user and group IDs of the specified or current user</td><td></td></tr>
<tr><td>/usr/bin/install</td><td>Copies files and sets attributes</td><td></td></tr>
<tr><td>/usr/bin/join</td><td>Joins lines of two files on a common field</td><td></td></tr>
<tr><td>/usr/bin/link</td><td>Creates hard links to files, no error checking</td><td></td></tr>
<tr><td>/usr/bin/logname</td><td>Print login name of current user</td><td></td></tr>
<tr><td>/usr/bin/md5sum</td><td>Calculates the MD5 hash of the given file or input</td><td></td></tr>
<tr><td>/usr/bin/nice</td><td>Makes a CPU heavy program yield to other processes</td><td></td></tr>
<tr><td>/usr/bin/nl</td><td>Add line numbers to a file</td><td></td></tr>
<tr><td>/usr/bin/nohup</td><td>Prevents a process from terminating when the parent terminal exits</td><td></td></tr>
<tr><td>/usr/bin/nproc</td><td>prints the number of processors</td><td></td></tr>
<tr><td>/usr/bin/numfmt</td><td>convert number formats</td><td></td></tr>
<tr><td>/usr/bin/od<td></td><td></td></tr>
<tr><td>/usr/bin/paste<td></td><td></td></tr>
<tr><td>/usr/bin/pathchk</td><td>check whether filenames are valid and/or portable between OSes</td><td></td></tr>
<tr><td>/usr/bin/pinky</td><td>lightweight client for the finger protocol</td><td></td></tr>
<tr><td>/usr/bin/pr</td><td>Converts the given file for printing to a printer</td><td></td></tr>
<tr><td>/usr/bin/printenv</td><td>prints environment variables</td><td></td></tr>
<tr><td>/usr/bin/printf</td><td>Formats data for output</td><td></td></tr>
<tr><td>/usr/bin/ptx<td></td><td></td></tr>
<tr><td>/usr/bin/realpath</td><td>print full resolved path (i.e follows symlinks)</td><td></td></tr>
<tr><td>/usr/bin/runcon</td><td>Run given command with specified SELINUX security context</td><td></td></tr>
<tr><td>/usr/bin/sha1sum</td><td>Calculates the SHA1 hash of the given file or input</td><td></td></tr>
<tr><td>/usr/bin/sha224sum</td><td>Calculates the SHA224 hash of the given file or input</td><td></td></tr>
<tr><td>/usr/bin/sha256sum</td><td>Calculates the SHA256 hash of the given file or input</td><td></td></tr>
<tr><td>/usr/bin/sha384sum</td><td>Calculates the SHA384 hash of the given file or input</td><td></td></tr>
<tr><td>/usr/bin/sha512sum</td><td>Calculates the SHA512 hash of the given file or input</td><td></td></tr>
<tr><td>/usr/bin/shred</td><td>Irreversibly destroy the given file(s)</td><td></td></tr>
<tr><td>/usr/bin/shuf</td><td>Generate random permutations of input lines/files</td><td></td></tr>
<tr><td>/usr/bin/split</td><td>split a file into parts</td><td></td></tr>
<tr><td>/usr/bin/stat</td><td>display file or file system statistics</td><td></td></tr>
<tr><td>/usr/bin/stdbuf</td><td>run command with modified buffers</td><td></td></tr>
<tr><td>/usr/bin/sum</td><td>calculates BSD checksum for given file</td><td></td></tr>
<tr><td>/usr/bin/tac/td><td>similar to /bin/cat, but works backwards</td><td></td></tr>
<tr><td>/usr/bin/tee<td></td><td></td></tr>
<tr><td>/usr/bin/test</td><td>tests the subsequent expression for truth</td><td></td></tr>
<tr><td>/usr/bin/timeout</td><td>sets a timeout on the given command</td><td></td></tr>
<tr><td>/usr/bin/truncate</td><td>shrink or enlarge the given file (can be destructive)</td><td></td></tr>
<tr><td>/usr/bin/tsort</td><td>topological sort the given file</td><td></td></tr>
<tr><td>/usr/bin/unexpand</td><td>converts blocks of multiple space characters to tabs</td><td></td></tr>
<tr><td>/usr/bin/uniq</td><td>remove adjacent duplicate lines from given file or input</td><td></td></tr>
<tr><td>/usr/bin/unlink</td><td>removes given file from the filesystem</td><td></td></tr>
<tr><td>/usr/bin/users</td><td>print a list of logged-in users</td><td></td></tr>
<tr><td>/usr/bin/who</td><td>prints a list of logged-in users</td><td></td></tr>
<tr><td>/usr/bin/whoami</td><td>prints effective username of the current user</td><td></td></tr>
{{TableEnd}}
{{TableEnd}}
The following core utils in /usr/bin are symlinks to their counterpart in /bin:


{{TableStart}}
<tr><td>basename</td></tr>
<tr><td>chroot</td></tr>
<tr><td>cut</td></tr>
<tr><td>dir</td></tr>
<tr><td>dirname</td></tr>
<tr><td>du</td></tr>
<tr><td>env</td></tr>
<tr><td>expr</td></tr>
<tr><td>head</td></tr>
<tr><td>mkfifo</td></tr>
<tr><td>mktmp</td></tr>
<tr><td>readlink</td></tr>
<tr><td>seq</td></tr>
<tr><td>sleep</td></tr>
<tr><td>sort</td></tr>
<tr><td>tail</td></tr>
<tr><td>touch</td></tr>
<tr><td>tr</td></tr>
<tr><td>tty</td></tr>
<tr><td>uname</td></tr>
<tr><td>vdir</td></tr>
<tr><td>wc</td></tr>
<tr><td>yes</td></tr>
{{TableEnd}}
{{PageNeedsUpdates}}
{{PageNeedsUpdates}}
{{EbuildFooter}}
{{EbuildFooter}}

Latest revision as of 23:54, January 28, 2024

Coreutils

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

The core utils package provides many essential Linux binaries: (Note that in some other distros, all these binaries exist in /usr/bin and /bin itself is a symlink to /usr/bin)

<
Binary nameBinary functionCommon Usage
/bin/basenameRemove leading directory components from a given directory listing.
/bin/catUsed to concatenate files and print them to stdout.cat file1 file2...
cat file
/bin/chgrpUsed to change group ownershipchgroup group /path/filename
/bin/chmodchange file mode bits
/bin/chownChange file ownership and group membershipchown user:group filename
chown -R user:group dirname
/bin/chrootTemporarily changes the current root to the specified pathchroot /newrootpath/
/bin/cpcopy files and directoriescp /path/file1 /path/file2
/bin/cutremove sections from each line of files
/bin/dateprint or set the system date and time
/bin/ddconvert and copy a file
/bin/dfreport file system space usagedf -h mountpoint
/bin/dirstrip last component from file name
/bin/dirnamestrip last component from file name
/bin/duestimate file space usagedu /path/
du -h /path/
/bin/echodisplay a line of textecho "hello world"
/bin/envrun a program in a modified environment
/bin/exprevaluate expressions
/bin/falsedo nothing, unsuccessfully
/bin/headoutput the first part of files
/bin/lnCreate hard and symbolic links between different files.
/bin/lsList files and directories on the filesystemls -alh /home/username/
/bin/mkdirCreate a new, empty directorymkdir /path/dirname
mkdir -p /path/all/these/dirs/are/new
/bin/mkfifomake FIFOs (named pipes)
/bin/mknodmake block or character special files
/bin/mktempcreate a temporary file or directory
/bin/mvMove a file to a different location on the filesystem.
/bin/pwdOutput the Present Working Directory.mv /path/oldfile /newpath/newfile
/bin/readlinkprint resolved symbolic links or canonical file names
/bin/rmRemove a file, directory, etc. from the filesystem.rm /path/filename
/bin/rmdirRemove a directory from the filesystem.rmdir /path/dirname
/bin/seqprint a sequence of numbers
/bin/sleepdelay for a specified amount of timesleep 10
/bin/sortsort lines of text files
/bin/sttychange and print terminal line settings
/bin/syncSynchronize cached writes to persistent storage
/bin/tailoutput the last part of filestail /var/log/messages
/bin/touchCreate an empty file on the filesystem.touch /path/filename
/bin/trtranslate or delete characters
/bin/truedo nothing, successfully
/bin/ttyprint the file name of the terminal connected to standard input
/bin/unameprint system informationuname -a
/bin/vdirlist directory contents
/bin/wcprint newline, word, and byte counts for each file
/bin/yesoutput a string repeatedly until killed
/usr/bin/[tests the subsequent expression for truth
/usr/bin/archprints the machine architecture, alias for /bin/uname -m
/usr/bin/b2sumcalculates the BLAKE2 checksum of the input
/usr/bin/base32Base32 encodes/decodes the given file or input
/usr/bin/base64Base64 encodes/decodes the given file or input
/usr/bin/basencencodes/decodes the given file or input using the specific encoding
/usr/bin/chconchange the SELINUX security context of the given file
/usr/bin/cksumcalculates the checksum of the given file using the specified algorithm
/usr/bin/commcompare two sorted files line by line
/usr/bin/csplituse patterns to split a file's content
/usr/bin/dircolorsoutputs commands to set colours used in ls output
/usr/bin/expandconverts tab characters to blocks of multiple space characters
/usr/bin/factorPrint the prime factors of the specified integer number
/usr/bin/fmtSimple text paragraph formatter
/usr/bin/foldWraps long lines in given file to specified width
/usr/bin/hostidPrints the numeric(hexdecimal) ID of the current machine
/usr/bin/idPrints the user and group IDs of the specified or current user
/usr/bin/installCopies files and sets attributes
/usr/bin/joinJoins lines of two files on a common field
/usr/bin/linkCreates hard links to files, no error checking
/usr/bin/lognamePrint login name of current user
/usr/bin/md5sumCalculates the MD5 hash of the given file or input
/usr/bin/niceMakes a CPU heavy program yield to other processes
/usr/bin/nlAdd line numbers to a file
/usr/bin/nohupPrevents a process from terminating when the parent terminal exits
/usr/bin/nprocprints the number of processors
/usr/bin/numfmtconvert number formats
/usr/bin/od
/usr/bin/paste
/usr/bin/pathchkcheck whether filenames are valid and/or portable between OSes
/usr/bin/pinkylightweight client for the finger protocol
/usr/bin/prConverts the given file for printing to a printer
/usr/bin/printenvprints environment variables
/usr/bin/printfFormats data for output
/usr/bin/ptx
/usr/bin/realpathprint full resolved path (i.e follows symlinks)
/usr/bin/runconRun given command with specified SELINUX security context
/usr/bin/sha1sumCalculates the SHA1 hash of the given file or input
/usr/bin/sha224sumCalculates the SHA224 hash of the given file or input
/usr/bin/sha256sumCalculates the SHA256 hash of the given file or input
/usr/bin/sha384sumCalculates the SHA384 hash of the given file or input
/usr/bin/sha512sumCalculates the SHA512 hash of the given file or input
/usr/bin/shredIrreversibly destroy the given file(s)
/usr/bin/shufGenerate random permutations of input lines/files
/usr/bin/splitsplit a file into parts
/usr/bin/statdisplay file or file system statistics
/usr/bin/stdbufrun command with modified buffers
/usr/bin/sumcalculates BSD checksum for given file
/usr/bin/tac/td>similar to /bin/cat, but works backwards
/usr/bin/tee
/usr/bin/testtests the subsequent expression for truth
/usr/bin/timeoutsets a timeout on the given command
/usr/bin/truncateshrink or enlarge the given file (can be destructive)
/usr/bin/tsorttopological sort the given file
/usr/bin/unexpandconverts blocks of multiple space characters to tabs
/usr/bin/uniqremove adjacent duplicate lines from given file or input
/usr/bin/unlinkremoves given file from the filesystem
/usr/bin/usersprint a list of logged-in users
/usr/bin/whoprints a list of logged-in users
/usr/bin/whoamiprints effective username of the current user

The following core utils in /usr/bin are symlinks to their counterpart in /bin:

basename
chroot
cut
dir
dirname
du
env
expr
head
mkfifo
mktmp
readlink
seq
sleep
sort
tail
touch
tr
tty
uname
vdir
wc
yes