注意:

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

Package:Coreutils

From Funtoo
Revision as of 23:54, January 28, 2024 by Loonylion (talk | contribs) (added all the remaining coreutils, with descriptions for most, common usages for some. Listed symlinks and note about other distro paths.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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