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